Bug 38344 - [4.3 Regression] bootstrap failure in libjava/link.cc (ICE in invariant_for_use)
Summary: [4.3 Regression] bootstrap failure in libjava/link.cc (ICE in invariant_for_use)
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.3
: P1 normal
Target Milestone: 4.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-12-01 10:58 UTC by Matthias Klose
Modified: 2008-12-09 16:35 UTC (History)
4 users (show)

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work: 4.3.2
Known to fail: 4.3.3
Last reconfirmed:


Attachments
preprocessed source (60.31 KB, application/x-bzip)
2008-12-01 10:59 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2008-12-01 10:58:45 UTC
seen with 4.3.3 20081029, seen the last successful bootstrap with 20081022, not seen on the trunk.

/home/doko/gcc/4.3/java/gcj-4.3-4.3.2/build/gcc/cc1plus -quiet -nostdinc++ -v -g -O2 -Wswitch-enum -Wextra -Wall -version -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -fPIC link.ii

Program received signal SIGSEGV, Segmentation fault.
invariant_for_use (use=0x8fde18) at ../../src/gcc/loop-invariant.c:251
251       basic_block bb = BLOCK_FOR_INSN (use->insn), def_bb;
(gdb) p use->insn
$1 = (rtx) 0x0
Comment 1 Matthias Klose 2008-12-01 10:59:36 UTC
Created attachment 16800 [details]
preprocessed source
Comment 2 Richard Biener 2008-12-01 11:06:30 UTC
Can you figure out which patch is the cause?
Comment 3 Matthias Klose 2008-12-01 11:08:53 UTC
doing this, but it will be slow ...
Comment 4 Matthias Klose 2008-12-06 06:59:36 UTC
works with r142144, not with r142179; the only non-fortran patch between these two revisions is 

r142149 | ebotcazou | 2008-11-24 09:36:43 +0100 (Mon, 24 Nov 2008) | 4 lines

        * df-scan.c (df_get_call_refs): For unconditional noreturn calls
        add EH_USES regs as artificial uses.
        (df_get_entry_block_def_set): Don't handle EH_USES here.
Comment 5 Eric Botcazou 2008-12-06 07:53:44 UTC
> works with r142144, not with r142179; the only non-fortran patch between these
> two revisions is 

Please confirm, this goes against your opening message in this PR.
Comment 6 Eric Botcazou 2008-12-06 08:11:00 UTC
> r142149 | ebotcazou | 2008-11-24 09:36:43 +0100 (Mon, 24 Nov 2008) | 4 lines
> 
>         * df-scan.c (df_get_call_refs): For unconditional noreturn calls
>         add EH_USES regs as artificial uses.
>         (df_get_entry_block_def_set): Don't handle EH_USES here.

This patch is a no-op on anything else than IA-64 anyway:

eric@atlantis:~/svn/gcc-4_3-branch/gcc> grep -r --exclude=*svn* --exclude=*ChangeLog* EH_USES .
./doc/tm.texi:@defmac EH_USES (@var{regno})
./doc/tm.texi:TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,
./config/m32c/m32c.h:#define EH_USES(REGNO) 0   /* FIXME */
./config/ia64/ia64.h:#define EH_USES(REGNO) ia64_eh_uses (REGNO)
./df-scan.c:#ifdef EH_USES
./df-scan.c:     BOTTOM of the block with noreturn call, as EH_USES registers need
./df-scan.c:    if (EH_USES (i))
./df-scan.c:#ifdef EH_USES
./df-scan.c:    if (EH_USES (i))
./df-problems.c:#ifdef EH_USES
./df-problems.c:#ifdef EH_USES
./df-problems.c:  /* Create the chains for the artificial uses from the EH_USES at the
./dce.c:#ifdef EH_USES
Comment 7 Eric Botcazou 2008-12-06 08:32:25 UTC
And I cannot reproduce with a cross:

eric@atlantis:~/build/gcc-4_3-branch/arm-linux-gnueabi> gcc/cc1plus -quiet -nostdinc++ -v -g -O2 -Wswitch-enum -Wextra -Wall -version -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -fPIC link.ii
ignoring nonexistent directory "/home/eric/install/gcc-4_3-branch/lib/gcc/arm-linux-gnueabi/4.3.3/include"
ignoring nonexistent directory "/home/eric/install/gcc-4_3-branch/lib/gcc/arm-linux-gnueabi/4.3.3/include-fixed"
ignoring nonexistent directory "/home/eric/install/gcc-4_3-branch/lib/gcc/../../arm-linux-gnueabi/sys-include"
ignoring nonexistent directory "/home/eric/install/gcc-4_3-branch/lib/gcc/../../arm-linux-gnueabi/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
GNU C++ (GCC) version 4.3.3 20081205 (prerelease) [gcc-4_3-branch revision 142479] (arm-linux-gnueabi)
        compiled by GNU C version 4.2.1 (SUSE Linux), GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d154bbd8150682481739de030e4f70a8
eric@atlantis:~/build/gcc-4_3-branch/arm-linux-gnueabi>
Comment 8 Matthias Klose 2008-12-08 22:32:46 UTC
a current snapshot from the branch, exluding r142149 works for me. I'll try to reduce the applied patches until the builds succeeds again with r142149, but again, this may take a while.
Comment 9 Eric Botcazou 2008-12-08 23:01:18 UTC
> a current snapshot from the branch, exluding r142149 works for me. I'll try to
> reduce the applied patches until the builds succeeds again with r142149, but
> again, this may take a while.

So are the dates in your first message correct or not?  IOW did you have the
failure *before* my patch?  If so, there is strictly no point in considering it.

It would also be interesting to attach the df-scan.i generated before and
after my patch.
Comment 10 Matthias Klose 2008-12-08 23:42:50 UTC
> So are the dates in your first message correct or not?

hmm, did reply to this, but probably in another report ...

"seen with 4.3.3 20081029, seen the last successful bootstrap with 20081022, not
seen on the trunk."

this should be 11 (Nov) instead of 10 (Oct).
Comment 11 Eric Botcazou 2008-12-09 10:58:44 UTC
> a current snapshot from the branch, exluding r142149 works for me. I'll try to
> reduce the applied patches until the builds succeeds again with r142149, but
> again, this may take a while.

The only possibility is some patch that defines EH_USES for ARM.
Comment 12 Matthias Klose 2008-12-09 15:28:30 UTC
sorry for not noticing earlier; indeded, this is a patch by CodeSourcery to enable to build libobjc.

see http://lists.debian.org/debian-gcc/2008/04/msg00240.html

I don't see this defined on the trunk. I suppose this report can be closed.
Comment 13 Jakub Jelinek 2008-12-09 16:06:51 UTC
Works with upstream 4.3 and on the trunk.
Comment 14 Eric Botcazou 2008-12-09 16:35:20 UTC
> sorry for not noticing earlier; indeded, this is a patch by CodeSourcery to
> enable to build libobjc.
> 
> see http://lists.debian.org/debian-gcc/2008/04/msg00240.html

Thanks.  The definition of EH_USES looks suspicious given

/* Use r0 and r1 to pass exception handling information.  */
#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM)

This might have been a work around for the problem fixed by

2008-11-25  Eric Botcazou  <ebotcazou@adacore.com>

	* regrename.c (merge_overlapping_regs): Add registers artificially
	defined at the top of the basic block to the set of live ones just
	before the first insn.