]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/10764 (ICE when using log(), -fast-math and optimization)
authorRoger Sayle <roger@eyesopen.com>
Wed, 14 May 2003 21:13:49 +0000 (21:13 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Wed, 14 May 2003 21:13:49 +0000 (21:13 +0000)
PR optimization/10764
* config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3):
Add an explicit clobber to show that UNSPEC_FPATAN clobbers st(1).
(*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3):  Likewise,
add an explicit clobber to show that UNSPEC_FYL2X clobbers st(1).
(logsf2, logdf2, logxf2, logtf2): Update expander patterns to match
the corresponding *fyl2x_?fxf3 instructions.

* gcc.dg/builtins-15.c: New test case.

From-SVN: r66811

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-15.c [new file with mode: 0644]

index d41138f548c3085335ccfa2dde97c8202d9fbd9e..81d9028302b737157742a1ea7d8b4e8d8562c7cd 100644 (file)
@@ -1,3 +1,13 @@
+2003-05-14  Roger Sayle  <roger@eyesopen.com>
+
+       PR optimization/10764
+       * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3): 
+       Add an explicit clobber to show that UNSPEC_FPATAN clobbers st(1).
+       (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3):  Likewise,
+       add an explicit clobber to show that UNSPEC_FYL2X clobbers st(1).
+       (logsf2, logdf2, logxf2, logtf2): Update expander patterns to match
+       the corresponding *fyl2x_?fxf3 instructions.
+
 2003-05-14  Richard Henderson  <rth@redhat.com>
 
        * config/ia64/ia64.c (ia64_expand_load_address): Force destination
index ad8909f939baaae1ea9c8e1ae7e70956eb335688..eb03cf2b8d55237ada91726b02dbd954b2b622f3 100644 (file)
    (set_attr "mode" "XF")])
 
 (define_insn "atan2df3"
-  [(set (match_operand:DF 0 "register_operand" "=f")
-       (unspec:DF [(match_operand:DF 2 "register_operand" "0")
-                   (match_operand:DF 1 "register_operand" "u")]
-        UNSPEC_FPATAN))]
+  [(parallel [(set (match_operand:DF 0 "register_operand" "=f")
+                  (unspec:DF [(match_operand:DF 2 "register_operand" "0")
+                              (match_operand:DF 1 "register_operand" "u")]
+                   UNSPEC_FPATAN))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fpatan"
    (set_attr "mode" "DF")])
 
 (define_insn "atan2sf3"
-  [(set (match_operand:SF 0 "register_operand" "=f")
-       (unspec:SF [(match_operand:SF 2 "register_operand" "0")
-                   (match_operand:SF 1 "register_operand" "u")]
-        UNSPEC_FPATAN))]
+  [(parallel [(set (match_operand:SF 0 "register_operand" "=f")
+                  (unspec:SF [(match_operand:SF 2 "register_operand" "0")
+                              (match_operand:SF 1 "register_operand" "u")]
+                   UNSPEC_FPATAN))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fpatan"
    (set_attr "mode" "SF")])
 
 (define_insn "atan2xf3"
-  [(set (match_operand:XF 0 "register_operand" "=f")
-       (unspec:XF [(match_operand:XF 2 "register_operand" "0")
-                   (match_operand:XF 1 "register_operand" "u")]
-        UNSPEC_FPATAN))]
+  [(parallel [(set (match_operand:XF 0 "register_operand" "=f")
+                  (unspec:XF [(match_operand:XF 2 "register_operand" "0")
+                              (match_operand:XF 1 "register_operand" "u")]
+                   UNSPEC_FPATAN))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fpatan"
    (set_attr "mode" "XF")])
 
 (define_insn "atan2tf3"
-  [(set (match_operand:TF 0 "register_operand" "=f")
-       (unspec:TF [(match_operand:TF 2 "register_operand" "0")
-                   (match_operand:TF 1 "register_operand" "u")]
-        UNSPEC_FPATAN))]
+  [(parallel [(set (match_operand:TF 0 "register_operand" "=f")
+                  (unspec:TF [(match_operand:TF 2 "register_operand" "0")
+                              (match_operand:TF 1 "register_operand" "u")]
+                   UNSPEC_FPATAN))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fpatan"
    (set_attr "mode" "XF")])
 
 (define_insn "*fyl2x_sfxf3"
-  [(set (match_operand:SF 0 "register_operand" "=f")
-       (unspec:SF [(match_operand:SF 2 "register_operand" "0")
-                   (match_operand:XF 1 "register_operand" "u")]
-        UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:SF 0 "register_operand" "=f")
+                  (unspec:SF [(match_operand:SF 2 "register_operand" "0")
+                              (match_operand:XF 1 "register_operand" "u")]
+                   UNSPEC_FYL2X))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fyl2x"
    (set_attr "mode" "SF")])
 
 (define_insn "*fyl2x_dfxf3"
-  [(set (match_operand:DF 0 "register_operand" "=f")
-       (unspec:DF [(match_operand:DF 2 "register_operand" "0")
-                   (match_operand:XF 1 "register_operand" "u")]
-        UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:DF 0 "register_operand" "=f")
+                  (unspec:DF [(match_operand:DF 2 "register_operand" "0")
+                              (match_operand:XF 1 "register_operand" "u")]
+                   UNSPEC_FYL2X))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fyl2x"
    (set_attr "mode" "DF")])
 
 (define_insn "*fyl2x_xf3"
-  [(set (match_operand:XF 0 "register_operand" "=f")
-       (unspec:XF [(match_operand:XF 2 "register_operand" "0")
-                   (match_operand:XF 1 "register_operand" "u")]
-        UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:XF 0 "register_operand" "=f")
+                  (unspec:XF [(match_operand:XF 2 "register_operand" "0")
+                              (match_operand:XF 1 "register_operand" "u")]
+                   UNSPEC_FYL2X))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fyl2x"
    (set_attr "mode" "XF")])
 
 (define_insn "*fyl2x_tfxf3"
-  [(set (match_operand:TF 0 "register_operand" "=f")
-       (unspec:TF [(match_operand:TF 2 "register_operand" "0")
-                   (match_operand:XF 1 "register_operand" "u")]
-        UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:TF 0 "register_operand" "=f")
+                  (unspec:TF [(match_operand:TF 2 "register_operand" "0")
+                              (match_operand:XF 1 "register_operand" "u")]
+                   UNSPEC_FYL2X))
+             (clobber (match_dup 1))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
   "fyl2x"
    (set_attr "mode" "XF")])
 
 (define_expand "logsf2"
-  [(set (match_operand:SF 0 "register_operand" "")
-       (unspec:SF [(match_operand:SF 1 "register_operand" "")
-                   (match_dup 2)] UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:SF 0 "register_operand" "")
+                  (unspec:SF [(match_operand:SF 1 "register_operand" "")
+                              (match_dup 2)] UNSPEC_FYL2X))
+             (clobber (match_dup 2))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
 {
 })
 
 (define_expand "logdf2"
-  [(set (match_operand:DF 0 "register_operand" "")
-       (unspec:DF [(match_operand:DF 1 "register_operand" "")
-                   (match_dup 2)] UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:DF 0 "register_operand" "")
+                  (unspec:DF [(match_operand:DF 1 "register_operand" "")
+                              (match_dup 2)] UNSPEC_FYL2X))
+             (clobber (match_dup 2))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
 {
 })
 
 (define_expand "logxf2"
-  [(set (match_operand:XF 0 "register_operand" "")
-       (unspec:XF [(match_operand:XF 1 "register_operand" "")
-                   (match_dup 2)] UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:XF 0 "register_operand" "")
+                  (unspec:XF [(match_operand:XF 1 "register_operand" "")
+                              (match_dup 2)] UNSPEC_FYL2X))
+             (clobber (match_dup 2))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
 {
 })
 
 (define_expand "logtf2"
-  [(set (match_operand:TF 0 "register_operand" "")
-       (unspec:TF [(match_operand:TF 1 "register_operand" "")
-                   (match_dup 2)] UNSPEC_FYL2X))]
+  [(parallel [(set (match_operand:TF 0 "register_operand" "")
+                  (unspec:TF [(match_operand:TF 1 "register_operand" "")
+                              (match_dup 2)] UNSPEC_FYL2X))
+             (clobber (match_dup 2))])]
   "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
    && flag_unsafe_math_optimizations"
 {
index ff54f0264e94bc89419b43c5624fafd414fcbec3..be4c76585a7d71ee041856a7c0c82ebcd21f0838 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-14  Roger Sayle  <roger@eyesopen.com>
+
+       * gcc.dg/builtins-15.c: New test case.
+
 2003-05-13  Zack Weinberg  <zack@codesourcery.com>
 
        * gcc.dg/const-elim-1.c: Tighten scan-assembler-not regexp.
diff --git a/gcc/testsuite/gcc.dg/builtins-15.c b/gcc/testsuite/gcc.dg/builtins-15.c
new file mode 100644 (file)
index 0000000..6d94c7e
--- /dev/null
@@ -0,0 +1,17 @@
+/* Derived from PR optimization/10764  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double log(double x);
+
+double ndtri(double y0)
+{
+  double x;
+
+  x = log(y0);
+  x = log(x);
+
+  return x;
+}
+
This page took 0.116555 seconds and 5 git commands to generate.