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]
Other format: [Raw text]

rs6000: Trivial code generation stupidity


Hija,

I just noticed that the current cvs gcc generates stupid
code for dead simple cases.

Consider:

int
foo (int a, int b)
{
  return b+1;
}

This will compile into:
foo:
        addi 4,4,1
        mr 3,4
        blr

What I would have expected is:
foo:
        addi 3,4,1
        blr

The same happens for floatingpoint code. If there's more then 1
parameter then I will always get a register move which is
really unnecessary. gcc 2.95.3 gets it right. Any ideas?

--
Servus,
       Daniel


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