re PR middle-end/21492 (ICE in try_crossjump_to_edge)

PR middle-end/21492
	* cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for
	src2 if src2 has been split.

	* g++.dg/opt/crossjump1.C: New test.

From-SVN: r99816
This commit is contained in:
Jakub Jelinek 2005-05-17 08:48:19 +02:00 committed by Jakub Jelinek
parent c477e13bd7
commit 7cbd12b88f
4 changed files with 42 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/21492
* cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for
src2 if src2 has been split.
PR tree-optimization/21610
* c-typeck.c (decl_constant_value_for_broken_optimization): If not
returning DECL, call unshare_expr.

View File

@ -1677,6 +1677,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
delete_basic_block (to_remove);
update_forwarder_flag (redirect_from);
if (redirect_to != src2)
update_forwarder_flag (src2);
return true;
}

View File

@ -1,5 +1,8 @@
2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/21492
* g++.dg/opt/crossjump1.C: New test.
PR tree-optimization/21610
* gcc.c-torture/compile/20050516-1.c: New test.

View File

@ -0,0 +1,33 @@
// PR middle-end/21492
// { dg-do compile }
// { dg-options "-Os -fPIC" }
extern char *bar (const char *, const char *);
extern char *baz (char *, const char *);
extern unsigned int fn (const char *);
static const struct C { int i; } k = { 0};
struct A
{
~A ();
};
char *
foo (char *x, const char *y)
{
A a;
char *c = x;
if (bar (y, "foo"))
{
baz (c, "foo");
c += fn ("foo");
}
else if (bar (y, "bar"))
{
baz (c, "bar");
c += fn ("bar");
}
return x;
}