[RS6000] Force source of fix_trunc<mode>si2 to reg
authorAlan Modra <amodra@gmail.com>
Wed, 3 Aug 2016 00:33:37 +0000 (10:03 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Wed, 3 Aug 2016 00:33:37 +0000 (10:03 +0930)
* config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand
to a reg.  Localize vars.

From-SVN: r239011

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index da112f402fb621c35b2d96362c44789d32b6f3b5..a75f39fdbbbdae42392148fe5462e0aa11c833fc 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-03  Alan Modra  <amodra@gmail.com>
+
+       * config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand
+       to a reg.  Localize vars.
+
 2016-08-03  Alan Modra  <amodra@gmail.com>
 
        * config/rs6000/rs6000.opt: Remove negatives from help strings
index 5afae92291c3b4bfa5235b43e2eda9b6a313c7d7..45ad66104fa814a051d517d941c1677b6fd39cbc 100644 (file)
 {
   if (!<E500_CONVERT>)
     {
-      rtx tmp, stack;
+      rtx src = force_reg (SFmode, operands[1]);
 
       if (TARGET_STFIWX)
-       emit_insn (gen_fix_trunc<mode>si2_stfiwx (operands[0], operands[1]));
+       emit_insn (gen_fix_trunc<mode>si2_stfiwx (operands[0], src));
       else
        {
-         tmp = gen_reg_rtx (DImode);
-         stack = rs6000_allocate_stack_temp (DImode, true, false);
-         emit_insn (gen_fix_trunc<mode>si2_internal (operands[0], operands[1],
+         rtx tmp = gen_reg_rtx (DImode);
+         rtx stack = rs6000_allocate_stack_temp (DImode, true, false);
+         emit_insn (gen_fix_trunc<mode>si2_internal (operands[0], src,
                                                      tmp, stack));
        }
       DONE;