aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-05-14 21:13:49 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-05-14 21:13:49 +0000
commite43736ad2e9788b5b02a39f38413c5fe693cb6cb (patch)
tree8032588c7df6b0368bf90602bec9b9e0d9964d37 /gcc/config
parentf42f5a1b1ec954dd53ea998ff4188c1de8001b0d (diff)
downloadgcc-e43736ad2e9788b5b02a39f38413c5fe693cb6cb.zip
gcc-e43736ad2e9788b5b02a39f38413c5fe693cb6cb.tar.gz
gcc-e43736ad2e9788b5b02a39f38413c5fe693cb6cb.tar.bz2
re PR rtl-optimization/10764 (ICE when using log(), -fast-math and optimization)
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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.md100
1 files changed, 56 insertions, 44 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index ad8909f..eb03cf2 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -15481,10 +15481,11 @@
(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"
@@ -15492,10 +15493,11 @@
(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"
@@ -15503,10 +15505,11 @@
(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"
@@ -15514,10 +15517,11 @@
(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"
@@ -15525,10 +15529,11 @@
(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"
@@ -15536,10 +15541,11 @@
(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"
@@ -15547,10 +15553,11 @@
(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"
@@ -15558,10 +15565,11 @@
(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"
@@ -15569,9 +15577,10 @@
(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"
{
@@ -15583,9 +15592,10 @@
})
(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"
{
@@ -15597,9 +15607,10 @@
})
(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"
{
@@ -15611,9 +15622,10 @@
})
(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"
{