For this code (from PR23525):
extern int waiting_for_initial_map;
extern int cp_pipe[2];
extern int pc_pipe[2];
extern int close (int __fd);
void
first_map_occurred(void)
{
close(cp_pipe[0]);
close(pc_pipe[1]);
waiting_for_initial_map = 0;
}
gcc -march=i686 -O2 generates:
movl cp_pipe, %eax
movl %eax, (%esp)
call close
movl pc_pipe+4, %eax
movl %eax, (%esp)
call close
The Intel compiler with the same flags generates:
pushl cp_pipe #9.11
call close #9.5
pushl 4+pc_pipe #10.11
call close #10.5
gcc -march=i686 -Os generates similar code to the Intel compiler.
Is there a performance difference between the movl + movl and pushl
code sequences? If not maybe then gcc should generate pushl for -O2
too because it is smaller code.
Thanks