diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-07 15:36:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-07 15:36:44 +0000 |
commit | 5d515644b7bb761525e6e349901f5f824dee4e31 (patch) | |
tree | a8bd80acafbee89a8f05d4a9fe4a1c34e3452fcf | |
parent | 03ffd04900cc119ff25f82ff5f291bee6773e3e7 (diff) | |
download | gcc-5d515644b7bb761525e6e349901f5f824dee4e31.tar.gz |
2006-02-07 Richard Guenther <rguenther@suse.de>
PR c++/26140
Revert
2006-01-30 Richard Guenther <rguenther@suse.de>
PR c++/23372
* gimplify.c (gimplify_target_expr): Handle easy cases
without creating a temporary.
Revert
2006-01-30 Richard Guenther <rguenther@suse.de>
PR c++/23372
* gcc.dg/pr23372-1.C: New testcase.
* g++.dg/tree-ssa/pr26140.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110699 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/gimplify.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/pr26140.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr23372-1.c | 10 |
5 files changed, 34 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9b17288851..5980e12cff2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2006-02-07 Richard Guenther <rguenther@suse.de> + + PR c++/26140 + Revert + 2006-01-30 Richard Guenther <rguenther@suse.de> + PR c++/23372 + * gimplify.c (gimplify_target_expr): Handle easy cases + without creating a temporary. + 2006-02-07 Pete Steinmetz <steinmtz@us.ibm.com> * sched-rgn.c (compute_dom_prob_ps, compute_trg_info): Eradicate diff --git a/gcc/gimplify.c b/gcc/gimplify.c index f64b1cbc8a8..8f951273b70 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4056,15 +4056,6 @@ 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd2fdab2921..8502775f102 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2006-02-07 Richard Guenther <rguenther@suse.de> + + PR c++/26140 + Revert + 2006-01-30 Richard Guenther <rguenther@suse.de> + PR c++/23372 + * gcc.dg/pr23372-1.C: New testcase. + + * g++.dg/tree-ssa/pr26140.C: New testcase. + 2006-02-07 Mark Mitchell <mark@codesourcery.com> PR c++/9737 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr26140.C b/gcc/testsuite/g++.dg/tree-ssa/pr26140.C new file mode 100644 index 00000000000..3e3743fbdbe --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr26140.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +struct Pitch +{ + int notename_; +}; +struct Audio_note +{ + Audio_note (Pitch p); +}; +void create_audio_elements () +{ + Pitch *pit; + new Audio_note (*pit); +} diff --git a/gcc/testsuite/gcc.dg/pr23372-1.c b/gcc/testsuite/gcc.dg/pr23372-1.c index 14149474eb3..e69de29bb2d 100644 --- a/gcc/testsuite/gcc.dg/pr23372-1.c +++ b/gcc/testsuite/gcc.dg/pr23372-1.c @@ -1,10 +0,0 @@ -/* { 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 } } */ |