Bug 20920 - [4.1 Regression] ICE with eh and VRP
Summary: [4.1 Regression] ICE with eh and VRP
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: build, ice-on-valid-code
: 20944 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-09 19:32 UTC by Kazu Hirata
Modified: 2005-04-11 15:09 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-04-09 19:33:58


Attachments
side-by-side diff (719 bytes, text/plain)
2005-04-09 19:47 UTC, Kazu Hirata
Details
side-by-side diff with blocks (960 bytes, text/plain)
2005-04-09 19:51 UTC, Kazu Hirata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kazu Hirata 2005-04-09 19:32:54 UTC
Consider:

void f(int) __attribute__((__noreturn__));
int d(const char *);
char * j ();

char *
foo (int x)
{
  char *path = __null;
  try
    {
      path = j ();
      if (path != __null)
	if (d (path) != 0)
	  f (127);
      f (127);
    }
  catch (...) { }

  return path;
}

With -O2, I get:

 Conflict path_1 and path_6 across an abnormal edge from BB5->BB6
test.cc: In function ‘char* foo(int)’:
test.cc:6: internal compiler error: SSA corruption
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The testcase is simplified a little bit from the one posted at:

http://gcc.gnu.org/ml/gcc-regression/2005-04/msg00031.html
Comment 1 Andrew Pinski 2005-04-09 19:33:58 UTC
Confirmed.
Comment 2 Andrew Pinski 2005-04-09 19:34:52 UTC
Adding build keyword as this is causing the powerpc-darwin build to fail.
Comment 3 Kazu Hirata 2005-04-09 19:47:30 UTC
Created attachment 8572 [details]
side-by-side diff

Here is a side-by-side diff between t23.dce2 and t24.vrp.
Comment 4 Kazu Hirata 2005-04-09 19:51:32 UTC
Created attachment 8573 [details]
side-by-side diff with blocks

side-by-side diff with blocks between t23.dce2 and t24.vrp.
Comment 5 Kazu Hirata 2005-04-10 03:34:14 UTC
Patch posted:

http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01050.html
Comment 6 Diego Novillo 2005-04-11 13:01:05 UTC
*** Bug 20944 has been marked as a duplicate of this bug. ***
Comment 7 GCC Commits 2005-04-11 15:06:12 UTC
Subject: Bug 20920

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dnovillo@gcc.gnu.org	2005-04-11 15:05:50

Modified files:
	gcc            : ChangeLog tree-pretty-print.c tree-vrp.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/tree-ssa: pr20920.C 

Log message:
	PR tree-optimization/20920
	* tree-pretty-print.c (dump_generic_node): Show '(ab)' if an
	SSA_NAME flows through an abnormal edge.
	* tree-vrp.c (infer_value_range): Ignore SSA names that flow
	through abnormal edges.
	(maybe_add_assert_expr): Likewise.
	
	PR tree-optimization/20920
	* g++.dg/tree-ssa/pr20920.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8227&r2=2.8228
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-pretty-print.c.diff?cvsroot=gcc&r1=2.56&r2=2.57
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vrp.c.diff?cvsroot=gcc&r1=2.2&r2=2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5324&r2=1.5325
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/pr20920.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 8 Diego Novillo 2005-04-11 15:09:40 UTC
Fixed.  http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01050.html