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/
*** This bug has been marked as a duplicate of bug 582682 ***