diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-04-09 12:04:24 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-04-09 12:04:24 +0200 |
commit | 39307ba788ba09db3d35eb8d920085bb9aebbece (patch) | |
tree | e2fa3b193c0435960fdf15ebaca3ceb42dc9c985 /gcc/tree-ssa-forwprop.c | |
parent | 83e03963466636419bccb8b08997164e93c1790b (diff) | |
download | gcc-39307ba788ba09db3d35eb8d920085bb9aebbece.zip gcc-39307ba788ba09db3d35eb8d920085bb9aebbece.tar.gz gcc-39307ba788ba09db3d35eb8d920085bb9aebbece.tar.bz2 |
re PR tree-optimization/56854 (error: non-decl/MEM_REF LHS in clobber statement)
PR tree-optimization/56854
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't
forward into clobber stmts if it would change MEM_REF lhs into
non-MEM_REF.
* g++.dg/torture/pr56854.C: New test.
From-SVN: r197625
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index edcf929..26b0761 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -826,7 +826,11 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, && integer_zerop (TREE_OPERAND (lhs, 1)) && useless_type_conversion_p (TREE_TYPE (TREE_OPERAND (def_rhs, 0)), - TREE_TYPE (gimple_assign_rhs1 (use_stmt)))) + TREE_TYPE (gimple_assign_rhs1 (use_stmt))) + /* Don't forward anything into clobber stmts if it would result + in the lhs no longer being a MEM_REF. */ + && (!gimple_clobber_p (use_stmt) + || TREE_CODE (TREE_OPERAND (def_rhs, 0)) == MEM_REF)) { tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0); tree new_offset, new_base, saved, new_lhs; |