unneeded stuff when call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a source:

  long var_x;

  void func()
  {
       var_x = 55;
  }

compile it (-S -O2 -fomit-frame-pointer file.c), and get

_func:
  movl $55, _var_x
  ret

---------------------------------------------------------
after I append some lines:

  long var_x;
  typedef void (*functype)();

  void func()
  {
       var_x = 55;
       ((functype)var_x)();
  }

compile it (-S -O2 -fomit-frame-pointer file.c), and get

_func:
  subl  $12, %esp         (1)
  movl  $55, %eax
  movl  $55, _var_x
  call  *%eax
  addl  $12, %esp         (1)
  ret

WHY compiler add lines (1)? It don't needed there!
Can compiler don't generate this lines?
  
gcc -v
gcc version 3.2.3 (mingw special 20030504-1)

-- 
Best regards,
 RomikB                          mailto:romikb@xxxxxxx


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux