Bug 31756 - g++ internal compiler error in change_stack when compiling -O2
g++ internal compiler error in change_stack when compiling -O2
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-13 18:17 EST by Jean-Francois Panisset
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-14 11:26:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jean-Francois Panisset 2001-03-13 18:17:39 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76C-SGI [en] (X11; I; IRIX64 6.5 IP30)

Try compiling the included test program with gcc-c++-2.96-69 on x86 with
-O2, you will
get an internal compiler error:

$ g++ -c -O2 sqrt.C 
sqrt.C: In function `float process_pixel (X)':
sqrt.C:12: Internal compiler error in change_stack, at reg-stack.c:2214
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Reproducible: Always
Steps to Reproduce:
Here is the test program:

__inline float sqrtf (float __x) 
  register float __result;
  __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x));
  return __result; 

class X
  virtual ~X() {}

class Y
  bool foo();

process_pixel(X x)
  Y y;
  if ( !y.foo() )
    return 1.0;
  return 28.0f * sqrtf(28.0);

Actual Results:  g++ internal compiler error (only with -O2, with -g, it
compiles fine).

Expected Results:  g++ shouldn't die.

The __inline definition of sqrtf() comes from math.h
Comment 1 Jakub Jelinek 2001-03-14 11:26:54 EST
I have fixed this in my tree, am just bootstrapping CVS gcc with it before
submitting it to gcc-patches. It will appear later on in gcc-2.96-79.

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