re PR middle-end/58956 (wrong code at -O1 and above (affecting gcc 4.6 to trunk))
2013-11-19 Richard Biener <rguenther@suse.de> PR middle-end/58956 * tree-ssa-ter.c (find_replaceable_in_bb): Avoid forwarding loads into stmts that may clobber it. * gcc.dg/torture/pr58956.c: New testcase. From-SVN: r205026
This commit is contained in:
parent
b4d05578ef
commit
7d07de0b2e
|
@ -1,3 +1,9 @@
|
||||||
|
2013-11-19 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/58956
|
||||||
|
* tree-ssa-ter.c (find_replaceable_in_bb): Avoid forwarding
|
||||||
|
loads into stmts that may clobber it.
|
||||||
|
|
||||||
2013-11-19 Bernd Schmidt <bernds@codesourcery.com>
|
2013-11-19 Bernd Schmidt <bernds@codesourcery.com>
|
||||||
|
|
||||||
* cgraphunit.c (symtab_terminator): New variable.
|
* cgraphunit.c (symtab_terminator): New variable.
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-11-19 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/58956
|
||||||
|
* gcc.dg/torture/pr58956.c: New testcase.
|
||||||
|
|
||||||
2013-11-19 Marek Polacek <polacek@redhat.com>
|
2013-11-19 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
* c-c++-common/ubsan/null-1.c: New test.
|
* c-c++-common/ubsan/null-1.c: New test.
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* { dg-do run } */
|
||||||
|
|
||||||
|
extern void abort (void);
|
||||||
|
|
||||||
|
struct S
|
||||||
|
{
|
||||||
|
int f0;
|
||||||
|
} a = {1}, b, g, *c = &b, **f = &c;
|
||||||
|
|
||||||
|
int *d, **e = &d, h;
|
||||||
|
|
||||||
|
struct S
|
||||||
|
foo ()
|
||||||
|
{
|
||||||
|
*e = &h;
|
||||||
|
if (!d)
|
||||||
|
__builtin_unreachable ();
|
||||||
|
*f = &g;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
struct S *i = c;
|
||||||
|
*i = foo ();
|
||||||
|
if (b.f0 != 1)
|
||||||
|
abort ();
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -602,8 +602,7 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
|
||||||
/* If the stmt does a memory store and the replacement
|
/* If the stmt does a memory store and the replacement
|
||||||
is a load aliasing it avoid creating overlapping
|
is a load aliasing it avoid creating overlapping
|
||||||
assignments which we cannot expand correctly. */
|
assignments which we cannot expand correctly. */
|
||||||
if (gimple_vdef (stmt)
|
if (gimple_vdef (stmt))
|
||||||
&& gimple_assign_single_p (stmt))
|
|
||||||
{
|
{
|
||||||
gimple def_stmt = SSA_NAME_DEF_STMT (use);
|
gimple def_stmt = SSA_NAME_DEF_STMT (use);
|
||||||
while (is_gimple_assign (def_stmt)
|
while (is_gimple_assign (def_stmt)
|
||||||
|
@ -612,8 +611,8 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
|
||||||
= SSA_NAME_DEF_STMT (gimple_assign_rhs1 (def_stmt));
|
= SSA_NAME_DEF_STMT (gimple_assign_rhs1 (def_stmt));
|
||||||
if (gimple_vuse (def_stmt)
|
if (gimple_vuse (def_stmt)
|
||||||
&& gimple_assign_single_p (def_stmt)
|
&& gimple_assign_single_p (def_stmt)
|
||||||
&& refs_may_alias_p (gimple_assign_lhs (stmt),
|
&& stmt_may_clobber_ref_p (stmt,
|
||||||
gimple_assign_rhs1 (def_stmt)))
|
gimple_assign_rhs1 (def_stmt)))
|
||||||
same_root_var = true;
|
same_root_var = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue