Fix out-of-bounds array accesses in ldexpxf3.
authorTom de Vries <tom@codesourcery.com>
Sat, 26 Apr 2014 16:32:56 +0000 (16:32 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 26 Apr 2014 16:32:56 +0000 (16:32 +0000)
2014-04-26  Tom de Vries  <tom@codesourcery.com>

* config/i386/i386.md (define_expand "ldexpxf3"): Fix out-of-bounds
array accesses.

From-SVN: r209824

gcc/ChangeLog
gcc/config/i386/i386.md

index ccb7964..26325e5 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-26  Tom de Vries  <tom@codesourcery.com>
+
+       * config/i386/i386.md (define_expand "ldexpxf3"): Fix out-of-bounds
+       array accesses.
+
 2014-04-25  Cary Coutant  <ccoutant@google.com>
 
         PR debug/60929
index 7db117c..fde0a93 100644 (file)
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
 {
+  rtx tmp1, tmp2;
   if (optimize_insn_for_size_p ())
     FAIL;
 
-  operands[3] = gen_reg_rtx (XFmode);
-  operands[4] = gen_reg_rtx (XFmode);
+  tmp1 = gen_reg_rtx (XFmode);
+  tmp2 = gen_reg_rtx (XFmode);
 
-  emit_insn (gen_floatsixf2 (operands[3], operands[2]));
-  emit_insn (gen_fscalexf4_i387 (operands[0], operands[4],
-                                 operands[1], operands[3]));
+  emit_insn (gen_floatsixf2 (tmp1, operands[2]));
+  emit_insn (gen_fscalexf4_i387 (operands[0], tmp2,
+                                 operands[1], tmp1));
   DONE;
 })