Bug 40347 - [4.5 Regression] i386-darwin ICEs while building libgcc during stage2
Summary: [4.5 Regression] i386-darwin ICEs while building libgcc during stage2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.5.0
: P3 blocker
Target Milestone: 4.5.0
Assignee: Richard Henderson
URL:
Keywords: build, ice-on-valid-code
: 40352 40611 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-04 21:13 UTC by Andrew Pinski
Modified: 2009-07-02 06:08 UTC (History)
6 users (show)

See Also:
Host: i386-darwin
Target: i386-darwin
Build: i386-darwin
Known to work:
Known to fail:
Last reconfirmed: 2009-07-01 20:42:05


Attachments
unwind-dw2-fde-glibc.i (38.35 KB, text/plain)
2009-07-01 18:22 UTC, Laurent GUERBY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2009-06-04 21:13:40 UTC
In file included from /Users/apinski/src/local/gcc/libgcc/../gcc/unwind-dw2-fde-darwin.c:34:0:/Users/apinski/src/local/gcc/libgcc/../gcc/unwind-pe.h: In function 'size_of_encoded_value':
/Users/apinski/src/local/gcc/libgcc/../gcc/unwind-pe.h:89:1: internal compiler error: in dwarf2out_frame_debug_adjust_cfa, at dwarf2out.c:1770
Please submit a full bug report,with preprocessed source if appropriate.

Why it does not fail during stage1 is interesting for me.
Comment 1 Laurent GUERBY 2009-06-04 22:14:04 UTC
I got the same on hppa-linux:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40338

See rev and commit info there.
Comment 2 Richard Henderson 2009-06-05 19:51:18 UTC
Laurent, I don't seem to be able to reproduce your PA problem
from a cross-compile.  Please attach a preprocessed file that
exhibits the problem.
Comment 3 Richard Henderson 2009-06-05 20:04:37 UTC
Likewise, Andrew, I'll need a preprocessed file.

Assuming something that doesn't show up w/ stage1 can even
be reproduced via cross-compiler.  Failing that, give me as
much information as you can about how the CFA variable changes
over the compilation of this function.
Comment 4 Debian GCC Maintainers 2009-06-22 08:45:11 UTC
A bootstrap on hppa-linux-gnu works for me with the patch suggested in PR 40462, still seeing a bootstrap failure on sparc-linux-gnu, as in PR40352. No preprocessed source yet.
Comment 5 Laurent GUERBY 2009-07-01 17:57:02 UTC
On sparc64-linux bootstrap worked at rev 147974 but failed at rev 148004 (far mmachine gcc62). I get the same failure on sparc-linux (farm machine gcc54).

I'll try to get a preprocessed file, another option is to get an account on the compile farm, procedure here:

http://gcc.gnu.org/wiki/CompileFarm
Comment 6 Laurent GUERBY 2009-07-01 18:22:47 UTC
Created attachment 18113 [details]
unwind-dw2-fde-glibc.i

unwind-dw2-fde-glibc.i

/home/guerby/build/./gcc/xgcc -B/home/guerby/build/./gcc/ -B/n/54/guerby/install-trunk/sparc64-unknown-linux-gnu/bin/ -B/n/54/guerby/install-trunk/sparc64-unknown-linux-gnu/lib/ -isystem /n/54/guerby/install-trunk/sparc64-unknown-linux-gnu/include -isystem /n/54/guerby/install-trunk/sparc64-unknown-linux-gnu/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I. -I../.././gcc -I../../../trunk/libgcc -I../../../trunk/libgcc/. -I../../../trunk/libgcc/../gcc -I../../../trunk/libgcc/../include  -DHAVE_CC_TLS -o unwind-dw2-fde-glibc.o -MT unwind-dw2-fde-glibc.o -MD -MP -MF unwind-dw2-fde-glibc.dep -fexceptions -c ../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c -fvisibility=hidden -DHIDE_EXPORTS
Comment 7 Laurent GUERBY 2009-07-01 18:28:04 UTC
backtrace

GNU C (GCC) version 4.5.0 20090701 (experimental) [trunk revision 149143] (sparc64-unknown-linux-gnu)
	compiled by GNU C version 4.3.3, GMP version 4.2.1, MPFR version 2.3.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 8427efa082a737e8dae184d16956f822
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c: In function '_Unwind_IteratePhdrCallback':
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:194:5: warning: jump skips variable initialization
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:274:2: note: label 'found' defined here
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:229:27: note: 'pc_high' declared here
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:194:5: warning: jump skips variable initialization
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:274:2: note: label 'found' defined here
../../../trunk/libgcc/../gcc/unwind-dw2-fde-glibc.c:229:15: note: 'pc_low' declared here

Breakpoint 1, internal_error (gmsgid=0x290eae8 "../../trunk/gcc/dwarf2out.c") at ../../trunk/gcc/diagnostic.c:674
674	  va_start (ap, gmsgid);
(gdb) bt
#0  internal_error (gmsgid=0x290eae8 "../../trunk/gcc/dwarf2out.c") at ../../trunk/gcc/diagnostic.c:674
#1  0x005d1e58 in fancy_abort (file=0x290eae8 "../../trunk/gcc/dwarf2out.c", line=2773, function=0x290efe8 "dwarf2out_begin_epilogue") at ../../trunk/gcc/diagnostic.c:730
#2  0x006251e4 in dwarf2out_begin_epilogue (insn=0xf769d3b0) at ../../trunk/gcc/dwarf2out.c:2773
#3  0x00789a44 in final_scan_insn (insn=0xf769d3b0, file=0x2b98160, optimize=2, nopeepholes=0, seen=0xffffce24) at ../../trunk/gcc/final.c:1893
#4  0x00789144 in final (first=0xf769cff0, file=0x2b98160, optimize=2) at ../../trunk/gcc/final.c:1714
#5  0x0078f554 in rest_of_handle_final () at ../../trunk/gcc/final.c:4226
#6  0x00cb0294 in execute_one_pass (pass=0x2abdff8) at ../../trunk/gcc/passes.c:1289
#7  0x00cb0558 in execute_pass_list (pass=0x2abdff8) at ../../trunk/gcc/passes.c:1338
#8  0x00cb0594 in execute_pass_list (pass=0x2af2394) at ../../trunk/gcc/passes.c:1339
#9  0x00cb0594 in execute_pass_list (pass=0x2af2360) at ../../trunk/gcc/passes.c:1339
#10 0x0140f160 in tree_rest_of_compilation (fndecl=0xf7a77900) at ../../trunk/gcc/tree-optimize.c:394
#11 0x01f75fb8 in cgraph_expand_function (node=0xf7bd4d00) at ../../trunk/gcc/cgraphunit.c:1098
#12 0x01f76250 in cgraph_expand_all_functions () at ../../trunk/gcc/cgraphunit.c:1157
#13 0x01f76b2c in cgraph_optimize () at ../../trunk/gcc/cgraphunit.c:1380
#14 0x000e3c7c in c_write_global_declarations () at ../../trunk/gcc/c-decl.c:9410
#15 0x010ab498 in compile_file () at ../../trunk/gcc/toplev.c:1037
#16 0x010ae928 in do_compile () at ../../trunk/gcc/toplev.c:2346
#17 0x010aea8c in toplev_main (argc=62, argv=0xffffd5c4) at ../../trunk/gcc/toplev.c:2391
#18 0x002dce20 in main (argc=62, argv=0xffffd5c4) at ../../trunk/gcc/main.c:35
(gdb) f 2
#2  0x006251e4 in dwarf2out_begin_epilogue (insn=0xf769d3b0) at ../../trunk/gcc/dwarf2out.c:2773
2773	  gcc_assert (i != NULL);
(gdb) l
2768	  if (!saw_frp)
2769	    return;
2770	
2771	  /* Otherwise, search forward to see if the return insn was the last
2772	     basic block of the function.  If so, we don't need save/restore.  */
2773	  gcc_assert (i != NULL);
2774	  i = next_real_insn (i);
2775	  if (i == NULL)
2776	    return;
2777	
(gdb)
(gdb) info local
saw_frp = 1 '\001'
i = (rtx) 0x0
__FUNCTION__ = "dwarf2out_begin_epilogue"
(gdb) info arg
insn = (rtx) 0xf769d3b0
(gdb) call debug_rtx(insn)
(note 19 8 17 NOTE_INSN_EPILOGUE_BEG)
(gdb)
Comment 8 Laurent GUERBY 2009-07-01 18:49:07 UTC
*** Bug 40352 has been marked as a duplicate of this bug. ***
Comment 9 Richard Henderson 2009-07-01 20:42:05 UTC
Mine.
Comment 10 Richard Henderson 2009-07-01 23:21:30 UTC
Subject: Bug 40347

Author: rth
Date: Wed Jul  1 23:21:17 2009
New Revision: 149158

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149158
Log:
	PR bootstrap/40347
	* function.c (reposition_prologue_and_epilogue_notes): If epilogue
	contained no insns, reposition note before last insn.

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

Comment 11 Richard Henderson 2009-07-01 23:33:41 UTC
Tested the fix for sparc; re-open if it's not fixed for darwin too.
Comment 12 Eric Botcazou 2009-07-02 06:08:28 UTC
*** Bug 40611 has been marked as a duplicate of this bug. ***