OSDN Git Service

2006-04-24 Andrew Pinski <pinskia@gcc.gnu.org>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Apr 2006 08:17:42 +0000 (08:17 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Apr 2006 08:17:42 +0000 (08:17 +0000)
Richard Guenther  <rguenther@suse.de>

PR tree-optimization/27218
* tree-inline.c (expand_call_inline): Strip useless type
conversions for the return slot address.

* g++.dg/tree-ssa/pr27218.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113218 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr27218.C [new file with mode: 0644]
gcc/tree-inline.c

index 9a23e66..0f66eac 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-24  Andrew Pinski  <pinskia@gcc.gnu.org>
+       Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/27218
+       * tree-inline.c (expand_call_inline): Strip useless type
+       conversions for the return slot address.
+
 2006-04-24  Richard Guenther  <rguenther@suse.de>
 
        * cfgloop.h (struct loops): Remove unused field array.  Reorder
index 535d2f5..326c31d 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-24  Andrew Pinski  <pinskia@gcc.gnu.org>
+       Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/27218
+       * g++.dg/tree-ssa/pr27218.C: New testcase.
+
 2006-04-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/26912
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27218.C b/gcc/testsuite/g++.dg/tree-ssa/pr27218.C
new file mode 100644 (file)
index 0000000..644d2fc
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct Vector
+{
+    double _x, _y;
+};
+typedef Vector Point;
+Vector d;
+static inline Vector f(void)
+{
+  return d;
+}
+void add_duck (void)
+{
+    new Point (f());
+}
index 525009e..6eb890b 100644 (file)
@@ -2073,6 +2073,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
       if (CALL_EXPR_RETURN_SLOT_OPT (t))
        {
          return_slot_addr = build_fold_addr_expr (modify_dest);
+         STRIP_USELESS_TYPE_CONVERSION (return_slot_addr);
          modify_dest = NULL;
        }
     }