Commit 0ec19b8c by Martin Jambor Committed by Martin Jambor

re PR tree-optimization/40432 (verify_stmts failed with -O2: non-register as LHS…

re PR tree-optimization/40432 (verify_stmts failed with -O2: non-register as LHS of unary operation)

2009-06-16  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/40432
	* tree-sra.c (sra_modify_assign): When creating VIEW_CONVERT_EXPR,
	check whether we need to force gimple register operand.

	* testsuite/gcc.c-torture/compile/pr40432.c: New file.

From-SVN: r148522
parent 3bc462c2
2009-06-16 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/40432
* tree-sra.c (sra_modify_assign): When creating VIEW_CONVERT_EXPR,
check whether we need to force gimple register operand.
2009-06-16 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/40413
* tree-sra.c (load_assign_lhs_subreplacements): Pass offset to
build_ref_for_offset.
......
2009-06-16 Martin Jambor <mjambor@suse.cz>
* testsuite/gcc.c-torture/compile/pr40432.c: New file.
2009-06-16 Martin Jambor <mjambor@suse.cz>
* testsuite/gfortran.fortran-torture/compile/pr40413.f90: New file.
2009-06-16 Janus Weil <janus@gcc.gnu.org>
......
/* Test that SRA produces valid gimple when handling both type punning by means
of VCE and creating an access to a union. */
union U {
struct something *sth;
void *nothing;
};
void
foo (union U *target, void *p)
{
union U u;
u.nothing = p;
*target = u;
return;
}
......@@ -2096,7 +2096,11 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
rhs = expr;
}
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
{
rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
if (!is_gimple_reg (lhs))
force_gimple_rhs = true;
}
}
if (force_gimple_rhs)
......
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