Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 746405 - internal compiler error: in modified_type_die, at dwarf2out.c:8495
internal compiler error: in modified_type_die, at dwarf2out.c:8495
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc (Show other bugs)
5.5
x86_64 Linux
unspecified Severity high
: rc
: ---
Assigned To: Jakub Jelinek
qe-baseos-tools
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-15 08:22 EDT by Brad Bell
Modified: 2012-02-21 01:27 EST (History)
3 users (show)

See Also:
Fixed In Version: gcc-4.1.2-52.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-21 01:27:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Executable bash shell script that describes and demonstrates the problem (1.03 KB, application/x-shellscript)
2011-10-15 08:22 EDT, Brad Bell
no flags Details
gcc41-rh746405.patch (1.46 KB, patch)
2011-10-21 12:14 EDT, Jakub Jelinek
jason: review-
Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0258 normal SHIPPED_LIVE gcc bug fix update 2012-02-20 10:06:48 EST

  None (edit)
Description Brad Bell 2011-10-15 08:22:28 EDT
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:
Comment 1 Jakub Jelinek 2011-10-21 12:14:57 EDT
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 2 Jason Merrill 2011-10-21 15:56:26 EDT
Comment on attachment 529534 [details]
gcc41-rh746405.patch

That seems like a reasonable workaround for 4.1.
Comment 3 Brad Bell 2011-10-25 15:29:54 EDT
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 ?
Comment 7 errata-xmlrpc 2012-02-21 01:27:45 EST
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

Note You need to log in before you can comment on or make changes to this bug.