internal compiler error: in tree_low_cst, at tree.c:4423 First, If I run this with -E, I get the preprocessed source that I will attach. vmfreebsd# gcc42 -E -g -I/usr/local/include -I/root/devel/dynamos/src/shared/include -I/root/devel/dynamos/src/framework/include -I/root/devel/dynamos/src/disassembler/slicer/include -I/root/devel/dynamos/src/os/include -I/root/devel/dynamos/config -I/root/devel/dynamos/src/libslicer/include -I/root/devel/dynamos/devel/include -c dynreplace.c > preprocessed_source.c And now, the bug: vmfreebsd# gcc42 -g -I/usr/local/include -I/root/devel/dynamos/src/shared/include -I/root/devel/dynamos/src/framework/include -I/root/devel/dynamos/src/disassembler/slicer/include -I/root/devel/dynamos/src/os/include -I/root/devel/dynamos/config -I/root/devel/dynamos/src/libslicer/include -I/root/devel/dynamos/devel/include -c dynreplace.c dynreplace.c: In function 'dynreplace_add_trampoline': dynreplace.c:71: warning: incompatible implicit declaration of built-in function 'memcpy' dynreplace.c:48: internal compiler error: in tree_low_cst, at tree.c:4423 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. vmfreebsd# gcc42 --version gcc42 (GCC) 4.2.0 20060218 (experimental) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vmfreebsd# uname -a FreeBSD vmfreebsd.mkgnu.net 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:32:43 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 This is running inside a VMWare virtual machine loaded with FreeBSD 6.1. No bug occurs when compiling with gcc-2.95 or gcc-3.3.4.
Created attachment 12210 [details] The preprocessed source that causes this bug.
gcc42 originated from running a: # pkg_add -r gcc42 in FreeBSD 6.1. This command installed the package gcc-4.2.0_20060218
Well 20060218 is almost 7 months ago but I get a different error with the mainline as of yesterday: dynreplace.c:110: internal compiler error: in loc_descriptor_from_tree_1, at dwarf2out.c:9407 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Reduced testcase: extern void dynreplace_trampoline(void); extern void dynreplace_trampoline_endlabel(void); int dynreplace_add_trampoline(void) { unsigned long trampoline_code[(((unsigned long) (&(dynreplace_trampoline_endlabel)) -(unsigned long) (&dynreplace_trampoline))) ]; }
Confirmed, note this is semi undefined code. Really this is a big weird as we are taking the difference between two function pointers. I think the ICE with tree_low_cst has been fixed but the ICE with loc_descriptor_from_tree_1 still exists.
This is just like PR 14492 now. Janis, Could you do a regression hunt on when the reduced testcase in comment #4 started to pass without any options? Thanks, Andrew
A regression hunt on powerpc-linux, using the reduced testcase from comment #4 with no options, identified this patch for which that test starts compiling cleanly: http://gcc.gnu.org/viewcvs?view=rev&rev=116450 r116450 | jsm28 | 2006-08-25 23:01:16 +0000 (Fri, 25 Aug 2006)
So the ICE in tree_low_cst has been fixed in the next releases of GCC 4.1.x and 4.0.x, that is good news but we still have the ICE in loc_descriptor_from_tree_1 now.
I have a fix for this which I am testing right now.
Subject: Bug number PR 28980 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00525.html
Subject: Bug 28980 Author: pinskia Date: Thu Sep 14 00:37:14 2006 New Revision: 116939 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116939 Log: 2006-09-13 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * dwarf2out.c (loc_descriptor_from_tree_1): Handle FUNCTION_DECL. 2006-09-13 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * gcc.c-torture/compile/debugvlafunction-1.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog
Fixed on the mainline at least.
Subject: Bug 28980 Author: pinskia Date: Thu Oct 5 14:33:46 2006 New Revision: 117456 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117456 Log: 2006-10-05 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * dwarf2out.c (loc_descriptor_from_tree_1): Handle FUNCTION_DECL. 2006-10-05 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * gcc.c-torture/compile/debugvlafunction-1.c: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c - copied unchanged from r116939, trunk/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/dwarf2out.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in 4.1 also.
Subject: Bug 28980 Author: pinskia Date: Mon Oct 9 04:25:44 2006 New Revision: 117568 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117568 Log: 2006-10-08 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * dwarf2out.c (loc_descriptor_from_tree_1): Handle FUNCTION_DECL. 2006-10-08 Andrew Pinski <pinskia@physics.uc.edu> PR debug/28980 * gcc.c-torture/compile/debugvlafunction-1.c: New test. Added: branches/gcc-4_0-branch/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c - copied unchanged from r116939, trunk/gcc/testsuite/gcc.c-torture/compile/debugvlafunction-1.c Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/dwarf2out.c branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
Fixed.