re PR middle-end/55114 (gcc.dg/builtins-53.c ICEs on mips64 soft-float)
authorRichard Sandiford <rdsandiford@googlemail.com>
Wed, 9 Jan 2013 18:19:16 +0000 (18:19 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 9 Jan 2013 18:19:16 +0000 (18:19 +0000)
gcc/
PR middle-end/55114
* expr.h (maybe_emit_group_store): Declare.
* expr.c (maybe_emit_group_store): New function.
* builtins.c (expand_builtin_int_roundingfn): Call it.
(expand_builtin_int_roundingfn_2): Likewise.

From-SVN: r195060

gcc/ChangeLog
gcc/builtins.c
gcc/expr.c
gcc/expr.h

index cbdc1adca959422b75878099ddb8cb2fc6911c5c..e57b0a48aa289c40e755c49bd3ecb68af59b8015 100644 (file)
@@ -1,3 +1,11 @@
+2013-01-09  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       PR middle-end/55114
+       * expr.h (maybe_emit_group_store): Declare.
+       * expr.c (maybe_emit_group_store): New function.
+       * builtins.c (expand_builtin_int_roundingfn): Call it.
+       (expand_builtin_int_roundingfn_2): Likewise.
+
 2013-01-09  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/pr55829
index 67c96df2689b654cb32e50e3399ad72c3979796e..2b615a17c100d727f59c21c5dff0eb1cc2cc5520 100644 (file)
@@ -2753,6 +2753,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target)
   exp = build_call_nofold_loc (EXPR_LOCATION (exp), fallback_fndecl, 1, arg);
 
   tmp = expand_normal (exp);
+  tmp = maybe_emit_group_store (tmp, TREE_TYPE (exp));
 
   /* Truncate the result of floating point optab to integer
      via expand_fix ().  */
@@ -2856,6 +2857,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target)
                                   fallback_fndecl, 1, arg);
 
       target = expand_call (exp, NULL_RTX, target == const0_rtx);
+      target = maybe_emit_group_store (target, TREE_TYPE (exp));
       return convert_to_mode (mode, target, 0);
     }
 
index e7b77707de8f770acf4d50d60fa41034354d77f0..08da907b3327380cc7641f1b0f48a9d07b7840d7 100644 (file)
@@ -2079,6 +2079,23 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
     emit_move_insn (orig_dst, dst);
 }
 
+/* Return a form of X that does not use a PARALLEL.  TYPE is the type
+   of the value stored in X.  */
+
+rtx
+maybe_emit_group_store (rtx x, tree type)
+{
+  enum machine_mode mode = TYPE_MODE (type);
+  gcc_checking_assert (GET_MODE (x) == VOIDmode || GET_MODE (x) == mode);
+  if (GET_CODE (x) == PARALLEL)
+    {
+      rtx result = gen_reg_rtx (mode);
+      emit_group_store (result, x, type, int_size_in_bytes (type));
+      return result;
+    }
+  return x;
+}
+
 /* Copy a BLKmode object of TYPE out of a register SRCREG into TARGET.
 
    This is used on targets that return BLKmode values in registers.  */
index c2168287cff080647684b8c77ffbccf9dde50816..b143d8eeb95bc497ad879c7ddf7046c043fbf399 100644 (file)
@@ -334,6 +334,8 @@ extern rtx emit_group_move_into_temps (rtx);
    PARALLEL.  */
 extern void emit_group_store (rtx, rtx, tree, int);
 
+extern rtx maybe_emit_group_store (rtx, tree);
+
 /* Copy BLKmode object from a set of registers.  */
 extern void copy_blkmode_from_reg (rtx, rtx, tree);