Bug 226706

Summary: Attached code crashes the compiler, error at: reload1.c:9508
Product: Red Hat Enterprise Linux 3 Reporter: Andrew Biggs <adb>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.8CC: aoliva
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2007-0473 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-11 17:50:14 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:
Attachments:
Description Flags
File referenced for attachment in error message.
none
Patch that fixes the bug none

Description Andrew Biggs 2007-02-01 01:33:16 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9

Description of problem:
A GCC internal error results from attempting to compile the following code with g++ and the -fnon-call-exceptions, -O2, and -fPIC options:

void foo() { 
     try {   
        float y = 10; 
        while (y > 0) {
            double z = (y / 10);
            y = z;
        }
     }        
     catch (...) {}
}

when using the following command line:



Version-Release number of selected component (if applicable):
gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-49)

How reproducible:
Always


Steps to Reproduce:
1. Copy the code given in the description of this bug report to foo.cpp.
2. Attempt to build foo.os using the command line:
      g++ -o foo.os -c -fnon-call-exceptions -O2 -fPIC foo.cpp
3. Compilation will fail, indicating an internal compiler error at reload1.c:9508.

Actual Results:
The compilation fails, here is the full error message from gcc:

foo.cpp: In function `void foo()':
foo.cpp:13: Internal compiler error in fixup_abnormal_edges, at reload1.c:9508
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
Preprocessed source stored into /tmp/ccW0oA9V.out file, please attach this to your bugreport.

Expected Results:
Should have built successfully.

Additional info:

Comment 1 Andrew Biggs 2007-02-01 15:39:24 UTC
Created attachment 147106 [details]
File referenced for attachment in error message.

Comment 2 Alexandre Oliva 2007-02-13 05:35:48 UTC
Created attachment 147957 [details]
Patch that fixes the bug

This bug is already fixed in GCC 4.1, as part of a patch that fixes a bigger
problem introduced afterwards.	This is a "backport" for 3.2 of the relevant
portion of the larger patch.

Comment 7 Jakub Jelinek 2007-03-26 12:50:30 UTC
Fixed in gcc-3.2.3-59.

Comment 11 Red Hat Bugzilla 2007-06-11 17:50:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0473.html