Bug 597380

Summary: SR #2023672 gcc fails with an internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067
Product: Red Hat Enterprise Linux 5 Reporter: Alan Matsuoka <alanm>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-tools-bugs
Severity: high Docs Contact:
Priority: high    
Version: 5.6   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-28 19:52:22 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 Alan Matsuoka 2010-05-28 19:22:45 UTC
Base OS: RHEL-5.5
Any arch

Problem Description:

gcc fails with an ICE (internal compiler error) when compiling a particular c++ code:

internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067

How Reproducible:

Always

Steps to reproduce:

Build the following program:

namespace
{
template <typename T>
class A
{
virtual T f1() { return c; }
static const T c = 0;
};
A<int> v;
}

g++ -c junk.cpp

Actual Results:

Compilation fails with the following error:

% gcc -c junk.cpp
junk.cpp: In instantiation of ‘const int <unnamed>::A<int>::c’:
junk.cpp:7:   instantiated from ‘T<unnamed>::A<T>::f1() [with T = int]’
junk.cpp:11:   instantiated from here
junk.cpp:8: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067
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/ccOodQtT.out file, please attach this to your bugreport.

Expected Result:

Compilation should finish successfully

Additional Information:

Upstream bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33094
Upstream  fix: http://gcc.gnu.org/viewcvs?view=revision&revision=128890

I have committed a minimal patch based on the above in a private branch 'private-SR2023672-branch' and created test packages for the customer. The customer has verified that the patch fixes the issue. Patch and test packages available here:

http://people.redhat.com/spoyarek/gcc-2023672/

Comment 1 Jakub Jelinek 2010-05-28 19:52:22 UTC

*** This bug has been marked as a duplicate of bug 582682 ***