Bug 40431 - [4.5 regression] ICE in div_data_align, at dwarf2out.c:533 while configuring sparcv9 libgcc
Summary: [4.5 regression] ICE in div_data_align, at dwarf2out.c:533 while configuring ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.5.0
: P3 critical
Target Milestone: ---
Assignee: Richard Henderson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-12 16:41 UTC by Rainer Orth
Modified: 2009-07-02 05:18 UTC (History)
3 users (show)

See Also:
Host: sparc*-sun-solaris2.*
Target: sparc*-sun-solaris2.*
Build: sparc*-sun-solaris2.*
Known to work:
Known to fail:
Last reconfirmed: 2009-07-01 05:46:30


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2009-06-12 16:41:24 UTC
Between 20090522 (rev 147798) and 20090612 (rev 148427), Solaris 11/SPARC
bootstrap broke configuring the stage1 sparcv9 libgcc: in config.log, I find

configure:2590: checking for suffix of object files
configure:2611: /vol/gccsrc/obj/gcc-4.5.0-20090612/11-gcc/./gcc/xgcc -B/vol/gccsrc/obj/gcc-4.5.0-20090612/11-gcc/./gcc/ -B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/vol/gcc/sparc-sun-solaris2.11/lib/ -isystem /vol/gcc/sparc-sun-solaris2.11/include -isystem /vol/gcc/sparc-sun-solaris2.11/sys-include  -m64 -c -g -O2  conftest.c >&5
conftest.c:16:1: internal compiler error: in div_data_align, at dwarf2out.c:533

This can be reproduced with this conftest.c:

int
main ()
{

  ;
  return 0;
}

ro@galeras 49 > ./cc1 conftest.i -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -m64 -g
 main
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <early_local_cleanups> <summary generate> <inline>Assembling functions:
 main
conftest.c:7:1: internal compiler error: in div_data_align, at dwarf2out.c:533
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Running cc1 under gdb, I find

Breakpoint 1, fancy_abort (file=0xe07518 "/vol/gcc/src/gcc-dist/gcc/dwarf2out.c", line=533, function=0xe07b60 "div_data_align") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:730
(gdb) where
#0  fancy_abort (file=0xe07518 "/vol/gcc/src/gcc-dist/gcc/dwarf2out.c", line=533, function=0xe07b60 "div_data_align") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:730
#1  0x0034cedc in div_data_align (off=2047) at /vol/gcc/src/gcc-dist/gcc/dwarf2out.c:533
#2  0x0034cb2c in output_cfi (cfi=0xff012360, fde=0x0, for_eh=0) at /vol/gcc/src/gcc-dist/gcc/dwarf2out.c:3044
#3  0x0034df58 in output_call_frame_info (for_eh=0) at /vol/gcc/src/gcc-dist/gcc/dwarf2out.c:3397
#4  0x0034f618 in dwarf2out_frame_finish () at /vol/gcc/src/gcc-dist/gcc/dwarf2out.c:3740
#5  0x007d5e48 in compile_file () at /vol/gcc/src/gcc-dist/gcc/toplev.c:1071
#6  0x007d9278 in do_compile () at /vol/gcc/src/gcc-dist/gcc/toplev.c:2353
#7  0x007d939c in toplev_main (argc=8, argv=0xffbff634) at /vol/gcc/src/gcc-dist/gcc/toplev.c:2398
#8  0x0021a63c in main (argc=8, argv=0xffbff634) at /vol/gcc/src/gcc-dist/gcc/main.c:35
(gdb) up
#1  0x0034cedc in div_data_align (off=2047) at /vol/gcc/src/gcc-dist/gcc/dwarf2out.c:533
(gdb) p r
$2 = -255
(gdb) p off
$3 = 2047

I suppose one of rth's recent DWARF patches is the culprit.

On the other hand, i386-pc-solaris2.10 is unaffected.
Comment 1 Rainer Orth 2009-06-22 14:08:23 UTC
The problem persists as of 20090622 (rev 148784).  Starting a reghunt now.
Comment 2 Rainer Orth 2009-06-22 17:25:45 UTC
Here's what the reghunt revealed:

* As of rev 148410, mainline ICEs building the 64-bit unwind-dw2-fde.o:

/vol/gcc/src/gcc-reghunt/libgcc/../gcc/unwind-dw2-fde.c:154:1: internal compiler error: in dwarf2out_begin_epilogue, at dwarf2out.c:2752

  This is fixed by applying the patch from Comment #1 of PR debug/40462.  This
  way, a C-only bootstrap finishes successfully.

* If I update this tree (with the patch) to rev 148411, I still get the ICE in
  div_data_align.  Thus, this patch

2009-06-11  Richard Henderson  <rth@redhat.com>

	* dwarf2out.c (def_cfa_1): Likewise for DW_CFA_cfa_offset.

	* dwarf2out.c (need_data_align_sf_opcode): New.
	(div_data_align): Move earlier.
	(def_cfa_1, reg_save): Use it.

  is the culprit.
Comment 3 Eric Botcazou 2009-07-01 05:45:53 UTC
Yep.
Comment 4 Eric Botcazou 2009-07-01 05:46:28 UTC
Investigating.
Comment 5 Richard Henderson 2009-07-01 14:56:19 UTC
You're right, it's my bug.
Comment 6 Richard Henderson 2009-07-01 23:16:27 UTC
Subject: Bug 40431

Author: rth
Date: Wed Jul  1 23:16:06 2009
New Revision: 149157

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149157
Log:
	PR debug/40431
	* dwarf2out.c (def_cfa_1): Revert 2009-06-11 change for
	DW_CFA_def_cfa_offset and DW_CFA_def_cfa.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c

Comment 7 Richard Henderson 2009-07-01 23:32:34 UTC
Fixed.