summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 08:17:42 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 08:17:42 +0000
commit1ab8c36eafa50ade5183af06f5b75e22f8cab634 (patch)
treeb054ea8cc3f2f50078c575535eb599d9731d331b /gcc
parent677144a018a688a3d70b1f5f26dcbd903b31d6b0 (diff)
downloadgcc-1ab8c36eafa50ade5183af06f5b75e22f8cab634.tar.gz
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. * 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr27218.C17
-rw-r--r--gcc/tree-inline.c1
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9a23e66e93b..0f66eac78ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 535d2f5b632..326c31d6a5b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..644d2fca9ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr27218.C
@@ -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());
+}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 525009eb738..6eb890b0ea2 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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;
}
}