This is the mail archive of the gcc-bugs@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]

RS/6000 assembly bug


I get a `fixed or forbidden register was spilled' message trying to
compile the following little function:

void
foo(int i)
{
    while (--i);

    __asm__ ("" : : : "cr0");
}

This also happens when I replace "cr0" with "cc", but does not happen
if I write "cr1".  This bug has been there at lease since gcc-2.6.3,
and it is really a general gcc bug, not specific to egcs.  I tested
this on the egcs-1.0.2 release.

One other minor thing.  It seems that this release (and more recent
gcc releases too) do not use the count register for loops.  Instead of
mtctr/bdn they use a GPR for the loop variable, and use
ai. r,r,-1;bne, although the count register is more efficient.

Gcc-2.6.3 did use the ctr (e.g. while (--i); created a bdn loop).

Thanks,

Zoli


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