This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCC-2.95.3 optimisation: constant copied to registers


  Hello,

  Reading the assembly generated by different software on i386,
 I have noticed that sometimes the constant '0' is copied to
 a register, and the register is used to initialise other
 register. For instance you can get:

  xor %esi,%esi
  mov %esi,%eax
  push %eax
  call fct
  mov %esi,%edx
  ...

 For the constant zero, this is better:
  xor %eax,%eax
  push %eax
  call fct
  xor %edx,%edx
  ...

 So, just if someone has the time, and the knowledge of where
 this optimisation is done, it would be nice to disable this
 when the constant is zero - for all other values this optimisation
 is good.

  Thanks for reading,
  Etienne.

___________________________________________________________
Do You Yahoo!? -- Pour faire vos courses sur le Net, 
Yahoo! Shopping : http://fr.shopping.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]