re PR middle-end/36326 (gimplification of aggregate copies introduces extra aggregate copy)

2008-12-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/36326
	* gimplify.c (is_gimple_mem_or_call_rhs): Remove work-around for
	non-BLKmode types.

	* gcc.dg/tree-ssa/pr36326.c: New testcase.

From-SVN: r142396
This commit is contained in:
Richard Guenther 2008-12-03 15:10:03 +00:00 committed by Richard Biener
parent cea1b9ebee
commit 050bbfebe2
4 changed files with 26 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2008-12-03 Richard Guenther <rguenther@suse.de>
PR middle-end/36326
* gimplify.c (is_gimple_mem_or_call_rhs): Remove work-around for
non-BLKmode types.
2008-12-03 Tomas Bily <tbily@suse.cz>
PR middle-end/38250

View file

@ -656,13 +656,8 @@ static bool
is_gimple_mem_or_call_rhs (tree t)
{
/* If we're dealing with a renamable type, either source or dest must be
a renamed variable. Also force a temporary if the type doesn't need
to be stored in memory, since it's cheap and prevents erroneous
tailcalls (PR 17526). */
if (is_gimple_reg_type (TREE_TYPE (t))
|| (TYPE_MODE (TREE_TYPE (t)) != BLKmode
&& (TREE_CODE (t) != CALL_EXPR
|| ! aggregate_value_p (t, t))))
a renamed variable. */
if (is_gimple_reg_type (TREE_TYPE (t)))
return is_gimple_val (t);
else
return is_gimple_formal_tmp_or_call_rhs (t);

View file

@ -1,3 +1,8 @@
2008-12-03 Richard Guenther <rguenther@suse.de>
PR middle-end/36326
* gcc.dg/tree-ssa/pr36326.c: New testcase.
2008-12-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37716

View file

@ -0,0 +1,13 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */
union X { int i; double x; };
int foo (union X *p)
{
union X x = *p;
return x.x;
}
/* { dg-final { scan-tree-dump-not "x.0" "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */