Red Hat Bugzilla – Bug 746405
internal compiler error: in modified_type_die, at dwarf2out.c:8495
Last modified: 2012-02-21 01:27:45 EST
Created attachment 528317 [details] Executable bash shell script that describes and demonstrates the problem Description of problem: The following command results in an internal compiler error gfortran -g -c bug.f -o bug.o Version-Release number of selected component (if applicable): GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50) How reproducible: very Steps to Reproduce: 1. Run the attached bash script Actual results: This shell script demonstrates a bug in GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50) When using that version of gfortran, the following error is generated: "bug.f:7: internal compiler error: in modified_type_die, at dwarf2out.c:8495" This occurs on a system with the following /etc/redhat-release: Red Hat Enterprise Linux Server release 5.5 (Tikanga) cd gfortran_bug_dwarf2out_8495 create bug.f gfortran -g -c bug.f -o bug.o bug.f: In function ‘mumps_369’: bug.f:7: internal compiler error: in modified_type_die, at dwarf2out.c:8495 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Expected results: This shell script demonstrates a but in GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50) When using that version of gfortran, the following error is generated: "bug.f:7: internal compiler error: in modified_type_die, at dwarf2out.c:8495" This occurs on a system with the following /etc/redhat-release: Red Hat Enterprise Linux Server release 5.5 (Tikanga) cd gfortran_bug_dwarf2out_8495 create bug.f gfortran -g -c bug.f -o bug.o Additional info:
Created attachment 529534 [details] gcc41-rh746405.patch I think this got fixed through the build_variant_type_copy -> build_distinct_type_copy change in http://gcc.gnu.org/PR40005. Unfortunately that relies on TYPE_CANONICAL, which is not present in GCC 4.1.2, so this is instead a hack which avoids the ICE and uses the right DIE. gen_type_die does: /* If this is an array type with hidden descriptor, handle it first. */ if (!TREE_ASM_WRITTEN (type) && lang_hooks.types.get_array_descr_info && lang_hooks.types.get_array_descr_info (type, &info)) { gen_descr_array_type_die (type, &info, context_die); TREE_ASM_WRITTEN (type) = 1; return; } /* We are going to output a DIE to represent the unqualified version of this type (i.e. without any const or volatile qualifiers) so get the main variant (i.e. the unqualified version) of this type now. (Vectors are special because the debugging info is in the cloned type itself). */ if (TREE_CODE (type) != VECTOR_TYPE) type = type_main_variant (type); if (TREE_ASM_WRITTEN (type)) return; and thus it is desirable not to use type_main_variant for VECTOR_TYPEs and fortran descr arrays, but calling the lang hook is costly.
Comment on attachment 529534 [details] gcc41-rh746405.patch That seems like a reasonable workaround for 4.1.
Would it be possible to just replace some part of the compiler executable, and make that part available on the web, instead of having to rebuild the compiler from source ?
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0258.html