Commit 39307ba7 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 83e03963
2013-04-09 Jakub Jelinek <jakub@redhat.com>
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.
2013-04-09 Maxim Kuvyrkov <maxim@kugelworks.com> 2013-04-09 Maxim Kuvyrkov <maxim@kugelworks.com>
* tree.c (type_hash_lookup, type_hash_add): Make static. * tree.c (type_hash_lookup, type_hash_add): Make static.
......
2013-04-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56854
* g++.dg/torture/pr56854.C: New test.
2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org> 2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/56782 PR fortran/56782
......
// PR tree-optimization/56854
// { dg-do compile }
inline void *
operator new (__SIZE_TYPE__, void *p) throw ()
{
return p;
}
struct A
{
int a;
A () : a (0) {}
~A () {}
A &operator= (const A &v) { this->~A (); new (this) A (v); return *this; }
};
A b[4], c[4];
void
foo ()
{
for (int i = 0; i < 4; ++i)
c[i] = b[i];
}
...@@ -826,7 +826,11 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, ...@@ -826,7 +826,11 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
&& integer_zerop (TREE_OPERAND (lhs, 1)) && integer_zerop (TREE_OPERAND (lhs, 1))
&& useless_type_conversion_p && useless_type_conversion_p
(TREE_TYPE (TREE_OPERAND (def_rhs, 0)), (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 *def_rhs_basep = &TREE_OPERAND (def_rhs, 0);
tree new_offset, new_base, saved, new_lhs; tree new_offset, new_base, saved, new_lhs;
......
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