This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC-2.95.3 optimisation: constant copied to registers
- To: gcc at gcc dot gnu dot org
- Subject: GCC-2.95.3 optimisation: constant copied to registers
- From: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- Date: Fri, 25 May 2001 11:04:33 +0200 (CEST)
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