Bug 31756 - g++ internal compiler error in change_stack when compiling -O2
Summary: g++ internal compiler error in change_stack when compiling -O2
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-13 23:17 UTC by Jean-Francois Panisset
Modified: 2007-04-18 16:32 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Jean-Francois Panisset 2001-03-13 23:17:39 UTC
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
{
public:
  X();
  virtual ~X() {}
};

class Y
{
public:
  Y();
  bool foo();
};

float
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 16:26:54 UTC
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.