diff options
author | Richard Biener <rguenther@suse.de> | 2013-11-19 13:28:35 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-11-19 13:28:35 +0000 |
commit | 7d07de0b2e51ec00494b6f5ffd0a0ab9f409dfb4 (patch) | |
tree | d1606dd653bef02ed1c44555e1bf88b1429b3874 /gcc/tree-ssa-ter.c | |
parent | b4d05578efc40cd1eaa1370d1bba58029c545ea0 (diff) | |
download | gcc-7d07de0b2e51ec00494b6f5ffd0a0ab9f409dfb4.zip gcc-7d07de0b2e51ec00494b6f5ffd0a0ab9f409dfb4.tar.gz gcc-7d07de0b2e51ec00494b6f5ffd0a0ab9f409dfb4.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r-- | gcc/tree-ssa-ter.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c index 883f950..9b9e655 100644 --- a/gcc/tree-ssa-ter.c +++ b/gcc/tree-ssa-ter.c @@ -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 is a load aliasing it avoid creating overlapping assignments which we cannot expand correctly. */ - if (gimple_vdef (stmt) - && gimple_assign_single_p (stmt)) + if (gimple_vdef (stmt)) { gimple def_stmt = SSA_NAME_DEF_STMT (use); 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)); if (gimple_vuse (def_stmt) && gimple_assign_single_p (def_stmt) - && refs_may_alias_p (gimple_assign_lhs (stmt), - gimple_assign_rhs1 (def_stmt))) + && stmt_may_clobber_ref_p (stmt, + gimple_assign_rhs1 (def_stmt))) same_root_var = true; } |