Bug 22422 - [4.1 Regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2843
Summary: [4.1 Regression] ICE in first_vi_for_offset, at tree-ssa-structalias.c:2843
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: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-07-12 02:30 UTC by Serge Belyshev
Modified: 2005-07-13 02:37 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-*-linux-gnu, powerpc64-darwin
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-12 04:23:26


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Belyshev 2005-07-12 02:30:51 UTC
//
// C testcase, compile with -O1

struct D
{
  int n;
  int c [8];
};

struct A
{
  int i;
  char *p;
};

struct B
{
  struct A *a;
  struct D *d;
};

int dtInsert1 (struct B *b)
{
  struct A a = { 0, 0 };
  struct D *d;

  b->a = &a;
  d = b->d;
  &d->c [d->n];
  return 0;
}

//

vi.i: In function ‘dtInsert1’:
vi.i:20: internal compiler error: in first_vi_for_offset, at
tree-ssa-structalias.c:2843

Backtrace:

Starting program: /home/ssb/src/build/gcc/cc1 -quiet
/home/ssb/src/bugs/pending/vi.i -O

Breakpoint 1, fancy_abort (
    file=0xc31230 "../../gcc41/gcc/tree-ssa-structalias.c", line=2843, 
    function=0xdf1c30 "first_vi_for_offset")
    at ../../gcc41/gcc/diagnostic.c:590
590	  internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb) bt
#0  fancy_abort (file=0xc31230 "../../gcc41/gcc/tree-ssa-structalias.c", 
    line=2843, function=0xdf1c30 "first_vi_for_offset")
    at ../../gcc41/gcc/diagnostic.c:590
#1  0x00000000009ded2f in first_vi_for_offset (start=0xed4320, offset=32)
    at ../../gcc41/gcc/tree-ssa-structalias.c:2843
#2  0x00000000009d5bfa in solution_set_add (set=0xed5100, offset=32)
    at ../../gcc41/gcc/tree-ssa-structalias.c:601
#3  0x00000000009d5fae in set_union_with_increment (to=0xed2ba0, 
    from=0xed2b60, inc=32) at ../../gcc41/gcc/tree-ssa-structalias.c:630
#4  0x00000000009da177 in solve_graph (graph=0xe9cda0)
    at ../../gcc41/gcc/tree-ssa-structalias.c:1716
#5  0x00000000009e153e in compute_points_to_sets (ai=0xebb2d0)
    at ../../gcc41/gcc/tree-ssa-structalias.c:3535
#6  0x000000000052f36d in compute_may_aliases ()
    at ../../gcc41/gcc/tree-ssa-alias.c:260
#7  0x00000000009b1bdc in execute_one_pass (pass=0xdde1c0)
    at ../../gcc41/gcc/passes.c:774
Comment 1 Andrew Pinski 2005-07-12 04:23:26 UTC
Confirmed, also fails on powerpc64-darwin.
Comment 2 GCC Commits 2005-07-13 02:25:58 UTC
Subject: Bug 22422

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-07-13 02:25:48

Modified files:
	gcc            : ChangeLog tree-ssa-structalias.c 

Log message:
	2005-07-12  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/22422
	* tree-ssa-structalias.c (struct variable_info): Add flag for
	special vars.
	(get_varinfo): Now a static function.
	(new_varinfo): init has_union and is_special_var to false.
	(solution_set_add): Check has_union.
	(do_da_constraint): Move temporary variable so it gets reset
	properly.
	Also check for special variable.
	(do_ds_constraint): Ditto.
	(do_sd_constraint): Ditto.
	(do_structure_copy): Check for special variable.
	(find_func_aliases): Ditto.
	(init_base_vars): Set special vars properly.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9424&r2=2.9425
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-structalias.c.diff?cvsroot=gcc&r1=2.17&r2=2.18

Comment 3 Andrew Pinski 2005-07-13 02:37:42 UTC
Fixed.