Bug 26755 - Gcc internal compiler error with gcc-2.96-69
Gcc internal compiler error with gcc-2.96-69
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-08 18:32 EST by Michael Jarvis
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-08 18:32:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Jarvis 2001-02-08 18:32:38 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i686; Nav)


When attempting to build asmutils from http://www.linuxassembly.org, the
compiler crashed when compiling asmutils-0.12/lib/libm.c.  

I narrowed down the offending code to this small example:

#define __SCALBN(ret,x,n)\
   asm("fscale"   :\
      "=t"(ret)   :\
      "0"(x),\
      "u"(n):\
      "st")

float scalbnf(float x,int n);

int main( int argc, char *argv[] )
{ 
        return 0;
}       

float scalbnf(float x,int n)
{
  register float ret;
  __SCALBN(ret,x,(float)n);
  return ret;
}

Compiling the above code generates the following error:
 > gcc foo.c ; rpm -qa | grep gcc
foo.c: In function `scalbnf':
foo.c:21: Internal compiler error in emit_swap_insn, at reg-stack.c:965
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
gcc-2.96-69
kgcc-1.1.2-40
gcc-objc-2.96-69
gcc-g77-2.96-69
gcc-c++-2.96-69





Reproducible: Always
Steps to Reproduce:
On a RedHat 7.0 machine with gcc-2.96-69 RPM installed and glibc-2.2-12,
compile following code:

#define __SCALBN(ret,x,n)\
   asm("fscale"   :\
      "=t"(ret)   :\
      "0"(x),\
      "u"(n):\
      "st")

float scalbnf(float x,int n);

int main( int argc, char *argv[] )
{
        return 0;
}

float scalbnf(float x,int n)
{
  register float ret;
  __SCALBN(ret,x,(float)n);
  return ret;
}


Actual Results:  foo.c: In function `scalbnf':
foo.c:21: Internal compiler error in emit_swap_insn, at reg-stack.c:965
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  It should compile.  :-)

I tried compiling the same code under egcs (from compat-egcs-6.2-1.1.2.9)
and it appeared to work fine.
Comment 1 Jakub Jelinek 2001-02-08 18:40:35 EST
It should not compile, the clobber is wrong:
you cannot at the same time have top of stack as output and clobber
it. Remove the "st" clobber and it will work.
gcc should not segfault on any input, that's true, but as __asm
is pretty low level gcc used to ICE on various bad __asm patterns
all the time, I don't give it very high priority.

Note You need to log in before you can comment on or make changes to this bug.