Commit 7cbd12b8 by Jakub Jelinek Committed by Jakub Jelinek

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
parent c477e13b
2005-05-17 Jakub Jelinek <jakub@redhat.com> 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 PR tree-optimization/21610
* c-typeck.c (decl_constant_value_for_broken_optimization): If not * c-typeck.c (decl_constant_value_for_broken_optimization): If not
returning DECL, call unshare_expr. returning DECL, call unshare_expr.
......
...@@ -1677,6 +1677,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) ...@@ -1677,6 +1677,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
delete_basic_block (to_remove); delete_basic_block (to_remove);
update_forwarder_flag (redirect_from); update_forwarder_flag (redirect_from);
if (redirect_to != src2)
update_forwarder_flag (src2);
return true; return true;
} }
......
2005-05-17 Jakub Jelinek <jakub@redhat.com> 2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/21492
* g++.dg/opt/crossjump1.C: New test.
PR tree-optimization/21610 PR tree-optimization/21610
* gcc.c-torture/compile/20050516-1.c: New test. * gcc.c-torture/compile/20050516-1.c: New test.
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment