Bug 88305

Summary: internal compiler error on attached source file
Product: [Retired] Red Hat Linux Reporter: Jeff Epler <jepler>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-03 19:53:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Epler 2003-04-08 19:09:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20021203

Description of problem:
A simple one-function C program causes an internal compiler error when compiled
with optimization (-O2).  This ICE may also exist in vanilla gcc-3.2.2

Version-Release number of selected component (if applicable):
gcc-3.2.2-5

How reproducible:
Always

Steps to Reproduce:
1. cat > p2l.ii <<EOF
extern double fabs(double x);

typedef struct { float x, y; } S;
typedef struct _T T;

extern void fT( T *p );
extern T *h();
extern S g( );

static
int f(void)
{
    T *t=0;
    int c=0;
    S s;

    const S exp_s = {0.,0.};

    if(!(t = h()))
    {
        c++;
    }

    if(!c)
    {
        s = g();
        if( (fabs( (s.x) - (exp_s.x) ) > 1 )
            || (fabs( (s.y) - (exp_s.y) ) > 1 ) )
        {
            c++;
        }
    }

    if(t)
        fT(t);

    return c;
}
EOF

2. gcc -O2 p2l.ii


Actual Results:  p2l.ii: In function `int f()':
p2l.ii:38: Internal compiler error in find_reloads_toplev, at reload.c:4439
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  successful generation of an object file

Additional info:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Comment 1 Jeff Epler 2003-06-17 20:57:21 UTC
I believe that this bug is fixed in gcc's 3.2.3 release, and either does not
exist or is fixed in 3.3 and trunk.

Comment 2 Jeff Epler 2003-12-22 03:28:33 UTC
The source file compiles without errors on Fedora Core with gcc-3.2.2-1

Comment 3 Richard Henderson 2004-10-03 19:53:55 UTC
Indeed, the ICE does not ocurr with 3.2.3.  I assume this was some
bug introduced and then fixed on the branch.