Bug 746405 - internal compiler error: in modified_type_die, at dwarf2out.c:8495
Summary: internal compiler error: in modified_type_die, at dwarf2out.c:8495
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc
Version: 5.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-15 12:22 UTC by Brad Bell
Modified: 2018-11-29 21:30 UTC (History)
3 users (show)

Fixed In Version: gcc-4.1.2-52.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-21 06:27:45 UTC
Target Upstream Version:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0258 0 normal SHIPPED_LIVE gcc bug fix update 2012-02-20 15:06:48 UTC

Description Brad Bell 2011-10-15 12:22:28 UTC
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 16:14:57 UTC
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 19:56:26 UTC
Comment on attachment 529534 [details]
gcc41-rh746405.patch

That seems like a reasonable workaround for 4.1.

Comment 3 Brad Bell 2011-10-25 19:29:54 UTC
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 06:27:45 UTC
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.