Bug 22071 - [4.1 regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2506
Summary: [4.1 regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2506
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Daniel Berlin
URL:
Keywords: ice-on-valid-code, monitored
: 22096 (view as bug list)
Depends on:
Blocks: 22096
  Show dependency treegraph
 
Reported: 2005-06-15 02:03 UTC by Jonathan Briggs
Modified: 2005-07-01 20:15 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-27 16:25:08


Attachments
Preprocessed code to reproduce bug (49.12 KB, text/x-c++src)
2005-06-15 02:03 UTC, Jonathan Briggs
Details
another test case (136.06 KB, application/x-bzip2)
2005-06-22 18:01 UTC, Benjamin Kosnik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Briggs 2005-06-15 02:03:12 UTC
# g++ -O /tmp/j1.cc
adaptors/lambda/lambda.cc: In function 'void
__static_initialization_and_destruction_0(int, int)':
adaptors/lambda/lambda.cc:15: internal compiler error: in first_vi_for_offset,
at tree-ssa-structalias.c:2506

j1.cc will be attached.
-O is what triggers the ICE.  Compiling without optimization works.

# g++ -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/gcc-4.1.0_beta20050611/work/gcc-4.1-20050611/configure
--enable-version-specific-runtime-libs --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.0-beta20050611
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.0-beta20050611/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.0-beta20050611
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.0-beta20050611/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.0-beta20050611/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.0-beta20050611/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --enable-multilib
--disable-libgcj --enable-languages=c,c++,f95 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.0 20050611 (experimental)
Comment 1 Jonathan Briggs 2005-06-15 02:03:55 UTC
Created attachment 9089 [details]
Preprocessed code to reproduce bug
Comment 2 Jonathan Briggs 2005-06-15 02:05:43 UTC
Oh, I marked it as a regression because gcc-4.0.1-beta20050526 seemed to work fine.
Comment 3 Andrew Pinski 2005-06-15 02:29:28 UTC
Confirmed, reduced testcase:
struct empty_class {};
struct class1 : empty_class
{
  class1() {}
  empty_class value_;
};
struct lambda : class1 { };
lambda _1;
Comment 4 Benjamin Kosnik 2005-06-22 17:59:43 UTC
I am running into this as well. Turning off all optimizations (-O0) allows
compilation, anything over -O1 hits it.
Comment 5 Benjamin Kosnik 2005-06-22 18:01:57 UTC
Created attachment 9128 [details]
another test case


For historical purposes only, since there is already a smaller testcase.
Comment 6 Andrew Pinski 2005-06-22 18:09:19 UTC
(In reply to comment #5)
> Created an attachment (id=9128)
> another test case

Hmm, that testcase is only reproducible on i686-pc-linux-gnu and not on powerpc-darwin, while the 
reduced one is on both.  I am going to reduce yours now.
Comment 7 Daniel Berlin 2005-06-22 18:54:00 UTC
Subject: Re:  [4.1 regression] ICE in
	first_vi_for_offset, at tree-ssa-structalias.c:2506

On Wed, 2005-06-22 at 17:59 +0000, bkoz at gcc dot gnu dot org wrote:
> ------- Additional Comments From bkoz at gcc dot gnu dot org  2005-06-22 17:59 -------
> 
> I am running into this as well. Turning off all optimizations (-O0) allows
> compilation, anything over -O1 hits it.
> 

This one is because of structures with a lot of holes in them, where we
make accesses that bridge the hole, and cna't ind the field that gets
associated with it.

> 

Comment 8 Benjamin Kosnik 2005-06-22 18:59:05 UTC
Ah, the old "can't find the tunnel at the end of the bridge at the end of this
hole" problem. Bummer. I hate it when that happens.

Is there an easier way than -O0 to revert back to the old behavior?
Comment 9 Andrew Pinski 2005-06-22 19:02:03 UTC
Subject: Re:  [4.1 regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2506


On Jun 22, 2005, at 2:59 PM, bkoz at gcc dot gnu dot org wrote:

>
> ------- Additional Comments From bkoz at gcc dot gnu dot org  
> 2005-06-22 18:59 -------
>
> Ah, the old "can't find the tunnel at the end of the bridge at the end 
> of this
> hole" problem. Bummer. I hate it when that happens.
>
> Is there an easier way than -O0 to revert back to the old behavior?

yes -fno-tree-salias.

-- Pinski

Comment 10 Daniel Berlin 2005-06-22 19:23:13 UTC
Subject: Re:  [4.1 regression] ICE in
	first_vi_for_offset, at tree-ssa-structalias.c:2506

On Wed, 2005-06-22 at 19:02 +0000, pinskia at physics dot uc dot edu
wrote:
> ------- Additional Comments From pinskia at physics dot uc dot edu  2005-06-22 19:02 -------
> Subject: Re:  [4.1 regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2506
> 
> 
> On Jun 22, 2005, at 2:59 PM, bkoz at gcc dot gnu dot org wrote:
> 
> >
> > ------- Additional Comments From bkoz at gcc dot gnu dot org  
> > 2005-06-22 18:59 -------
> >
> > Ah, the old "can't find the tunnel at the end of the bridge at the end 
> > of this
> > hole" problem. Bummer. I hate it when that happens.
> >
> > Is there an easier way than -O0 to revert back to the old behavior?
> 
> yes -fno-tree-salias.
> 

No, that won't help either :)


There is no way to revert to the old behavior, you'd have to add flags
for PTA, which will break the SSA path, since we rely on it)

Comment 11 Benjamin Kosnik 2005-06-22 20:13:25 UTC
Can somebody do a binary search and find out what patch or patches broke this?
Comment 12 Andrew Pinski 2005-06-22 20:29:52 UTC
(In reply to comment #11)
> Can somebody do a binary search and find out what patch or patches broke this?
No need to as it is obvious what caused it as the person who caused it already commented on this, it 
was introduced when tree-ssa-structalias.c was added.
2005-06-08  Daniel Berlin  <dberlin@dberlin.org>

        * Makefile.in (OBJS-common): Add tree-ssa-structalias.o.
....
Comment 13 Daniel Berlin 2005-06-22 20:50:50 UTC
Subject: Re:  [4.1 regression] ICE in
	first_vi_for_offset, at tree-ssa-structalias.c:2506

On Wed, 2005-06-22 at 20:13 +0000, bkoz at gcc dot gnu dot org wrote:
> ------- Additional Comments From bkoz at gcc dot gnu dot org  2005-06-22 20:13 -------
> 
> Can somebody do a binary search and find out what patch or patches broke this?
> 
> 
I know what broke it.
It was the structalias commit i did when it was added to the mainline.
I'll fix it in the next few days.


Comment 14 Daniel Berlin 2005-06-27 16:25:08 UTC
mine
Comment 15 Daniel Berlin 2005-07-01 03:37:09 UTC
The patch http://gcc.gnu.org/ml/gcc-patches/2005-06/msg02173.html
combined with http://gcc.gnu.org/ml/gcc-patches/2005-06/msg02246.html
should fix the bugs.

(Sorry for the delay, i hit some latent issues in the C++ FE while fixing these,
which is what the second patch fixes).
Comment 16 Andrew Pinski 2005-07-01 19:16:48 UTC
*** Bug 22096 has been marked as a duplicate of this bug. ***
Comment 17 CVS Commits 2005-07-01 19:45:31 UTC
Subject: Bug 22071

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-07-01 19:45:24

Modified files:
	gcc            : ChangeLog tree-ssa-structalias.c 
Added files:
	gcc/testsuite/g++.dg/tree-ssa: pr22071.C 

Log message:
	2005-06-29  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/22071
	
	* tree-ssa-structalias.c (offset_overlaps_with_access): New
	function.
	(get_constraint_for_component_ref): Use it.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9309&r2=2.9310
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-structalias.c.diff?cvsroot=gcc&r1=2.8&r2=2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/pr22071.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 18 Andrew Pinski 2005-07-01 20:15:20 UTC
Fixed.