re PR c++/23372 (Temporary aggregate copy not elided when passing parameters by value)
2006-01-30 Richard Guenther <rguenther@suse.de> PR c++/23372 * gimplify.c (gimplify_target_expr): Handle easy cases without creating a temporary. * gcc.dg/pr23372-1.C: New testcase. From-SVN: r110396
This commit is contained in:
parent
4e852d1f9d
commit
eb73a69a15
@ -1,3 +1,9 @@
|
||||
2006-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c++/23372
|
||||
* gimplify.c (gimplify_target_expr): Handle easy cases
|
||||
without creating a temporary.
|
||||
|
||||
2006-01-30 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* vec.h (safe_grow): Remove duplicated line.
|
||||
|
@ -4053,6 +4053,15 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
|
||||
|
||||
if (init)
|
||||
{
|
||||
/* Try to avoid the temporary if possible. */
|
||||
if (TREE_CODE (init) == INDIRECT_REF
|
||||
&& !TREE_SIDE_EFFECTS (init)
|
||||
&& !TARGET_EXPR_CLEANUP (targ))
|
||||
{
|
||||
*expr_p = init;
|
||||
return GS_OK;
|
||||
}
|
||||
|
||||
/* TARGET_EXPR temps aren't part of the enclosing block, so add it
|
||||
to the temps list. */
|
||||
gimple_add_tmp_var (temp);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2006-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c++/23372
|
||||
* gcc.dg/pr23372-1.C: New testcase.
|
||||
|
||||
2006-01-29 Diego Novillo <dnovillo@redhat.com>
|
||||
|
||||
* gcc.dg/gomp/pr25874.c: New test.
|
||||
|
10
gcc/testsuite/gcc.dg/pr23372-1.c
Normal file
10
gcc/testsuite/gcc.dg/pr23372-1.c
Normal file
@ -0,0 +1,10 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Os" } */
|
||||
|
||||
struct A {
|
||||
int a[1000];
|
||||
};
|
||||
void f(struct A);
|
||||
void g(struct A *a) { f(*a); }
|
||||
|
||||
/* { dg-final { scan-assembler-times "memcpy" 1 } } */
|
Loading…
Reference in New Issue
Block a user