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]

Re: x86 asm bug in binutils 2.9.1.0.4


On Thu, Jul 02, 1998 at 12:41:47PM -0700, H.J. Lu wrote:
> > Compiling Lesstif-0.85 on my x86 box with egcs 19980608 snapshot gives me:
> > 
> > gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include/Motif-1.2
> > -I../../include/Motif-1.2 -I../../include -I../../include -I/usr/X11R6/include
> > -g -Wall -DNONSTANDARD_CONVERTERS -DLESSTIF_VERBOSE -s -fPIC -DPIC Visual.c 
> > Visual.c: In function `_XmRegisterPixmapConverters':
> > Visual.c:1220: warning: type defaults to `int' in declaration of `inited'
> > Visual.c: At top level:
> > Visual.c:25: warning: `rcsid' defined but not used
> > /tmp/cca22201.s: Assembler messages:
> > /tmp/cca22201.s:3886: Error: operands given don't match any known 386
> > instruction
> > /tmp/cca22201.s:3925: Error: operands given don't match any known 386
> > instruction
> > /tmp/cca22201.s:4020: Error: operands given don't match any known 386
> > instruction
> > /tmp/cca22201.s:4059: Error: operands given don't match any known 386
> > instruction
> > /tmp/cca22201.s:4154: Error: operands given don't match any known 386
> > instruction
> > /tmp/cca22201.s:4193: Error: operands given don't match any known 386
> > instruction
> > 
> > Which turns to come from:
> > 
> > syl@holiday:~/lesstif-0.85/lib/Xm> grep -n fistll Visual.s  
> > 3886:   fistll -72(%ebp)
> > 3925:   fistll -72(%ebp)
> > 4020:   fistll -72(%ebp)
> > 4059:   fistll -72(%ebp)
> > 4154:   fistll -72(%ebp)
> > 4193:   fistll -72(%ebp)
> 
> "fistll -72(%ebp)" is illegal. Please send me a small testcase
> to show the egcs bug.

---------
#define FLOOR(x) ((int)((x) - 0.5) > (x) ? (x) : (x)-1)

void
_XmHSV2RGB(double h,
           double s,
           double v,
           unsigned short *rr,
           unsigned short *gr,
           unsigned short *br)
{
    int j;
    double rd, gd, bd;
    double p, q, t;

        switch (j)
        {
        case 0: rd = v; gd = t; bd = p; break;
        case 1: rd = q; gd = v; bd = p; break;
        case 2: rd = p; gd = v; bd = t; break;
        case 3: rd = p; gd = q; bd = v; break;
        }
    
    *br = (unsigned short)FLOOR((bd * 65535.0) + 0.5);
}
--------

Compile the code above with  "gcc -c -fPIC simple_visual.c" produces:
/tmp/cca23454.s: Assembler messages:
/tmp/cca23454.s:190: Error: operands given don't match any known 386
instruction
/tmp/cca23454.s:229: Error: operands given don't match any known 386
instruction

Removing "-fPIC" makes it work...

-- 
Sylvain


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