OSDN Git Service

2006-02-07 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Feb 2006 15:36:44 +0000 (15:36 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Feb 2006 15:36:44 +0000 (15:36 +0000)
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

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr26140.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr23372-1.c

index b9b1728..5980e12 100644 (file)
@@ -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
index f64b1cb..8f95127 100644 (file)
@@ -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);
index dd2fdab..8502775 100644 (file)
@@ -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 (file)
index 0000000..3e3743f
--- /dev/null
@@ -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);
+}
index 1414947..e69de29 100644 (file)
@@ -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 } } */