re PR tree-optimization/56424 (ICE at tree-inline.c:2833 on a-nllcef.ads at -O2)
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 4 Mar 2013 17:41:32 +0000 (17:41 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 4 Mar 2013 17:41:32 +0000 (17:41 +0000)
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.

From-SVN: r196439

gcc/ChangeLog
gcc/ipa-split.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr56424.c [new file with mode: 0644]

index 8a290e4a0de48d036e2ff35337704e9341a2f6a5..175a619524bf50e4d4ca6750d770af337d7d549c 100644 (file)
@@ -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 
index e3db78f5c0598078cd5e7dc49f57e9886192188b..e7d469d74423a3b6c7720220ad820ef34f430fee 100644 (file)
@@ -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,
index efe71e54c3f9cfa9df4fa3c4e880c028b87e7176..19c64d61f64e5e91d57a6354a23593bfcc8676bd 100644 (file)
@@ -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 (file)
index 0000000..a724c64
--- /dev/null
@@ -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);
+}