aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-split.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/pr56424.c33
4 files changed, 46 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8a290e4..175a619 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/56424
+ * ipa-split.c (split_function): Do not set the RSO flag if result is
+ not by reference and its type is a register type.
+
2013-03-04 David Holsgrove <david.holsgrove@xilinx.com>
* config/microblaze/microblaze.c (microblaze_valid_pic_const): New
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index e3db78f..e7d469d 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1309,7 +1309,9 @@ split_function (struct split_point *split_point)
so return slot optimization is always possible. Moreover this is
required to make DECL_BY_REFERENCE work. */
if (aggregate_value_p (DECL_RESULT (current_function_decl),
- TREE_TYPE (current_function_decl)))
+ TREE_TYPE (current_function_decl))
+ && (!is_gimple_reg_type (TREE_TYPE (DECL_RESULT (current_function_decl)))
+ || DECL_BY_REFERENCE (DECL_RESULT (current_function_decl))))
gimple_call_set_return_slot_opt (call, true);
/* Update return value. This is bit tricky. When we do not return,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index efe71e5..19c64d6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr56424.c: New test.
+
2013-03-04 Georg-Johann Lay <avr@gjlay.de>
* gcc.dg/pr55153.c: Add dg-require-effective-target scheduling.
diff --git a/gcc/testsuite/gcc.dg/pr56424.c b/gcc/testsuite/gcc.dg/pr56424.c
new file mode 100644
index 0000000..a724c64
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56424.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/56424 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+
+extern long double cosl (long double);
+extern long double sinl (long double);
+extern long double reml (long double, long double);
+
+long double my_cos (long double arg)
+{
+ return cosl (arg);
+}
+
+long double my_sin (long double arg)
+{
+ if (__builtin_fabs (arg) < 1.0)
+ return arg;
+
+ return sinl (arg);
+}
+
+long double my_cot (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_cos (t) / my_sin (t);
+}
+
+long double my_tan (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_sin (t) / my_cos (t);
+}