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:
parent
c477e13bd7
commit
7cbd12b88f
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
||||
|
33
gcc/testsuite/g++.dg/opt/crossjump1.C
Normal file
33
gcc/testsuite/g++.dg/opt/crossjump1.C
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user