new imaginary x86 addressing mode used

Robert Lipe robertl@sco.com
Wed Apr 14 09:19:00 GMT 1999


This is new in the trunk in the last two days.  It's likely a result of
the recent flurry of activity in i386.

We seem to have unearthed another of those addressing modes that
GAS lets you "get away with". Stricter assemblers don't find this
amusing.  This shows up during bootstrap on all my System V-derived x86
targets.  It's actually triggered building libF77/h_abs but it isn't
fortran-specific.

Testcase:

short h_abs(short *x)
{
if(*x >= 0)
        return(*x);
return(- *x);

}
$ ./xgcc -B./ x.i               
/usr/tmp/cctwgaaa.s:24:invalid register for instruction: %cx in negl


The hunk in question looks like this:

.L3:
        movl 8(%ebp),%eax
        movzwl (%eax),%ecx
        negl %cx			<- If it's long, it's %ecx, right?
        movswl %cx,%edx
        movl %edx,%eax
        jmp .L2


Let me know if you need additional information.

Thanx,
RJL


More information about the Gcc-bugs mailing list