------- Additional Comments From uros at kss-loka dot si 2005-01-21 06:48
-------
I hope this analysis is of some help:
- the patch in comment #2 fixes the problem
- if bypass_code is cleared for (code == LT) in ix86_expand_branch() _and_
ix86_fp_comparison_fcomi_cost() the problem shows again. It should be cleared in
both places, other places doesn't affect the problem.
- TARGET_SSE_MATH part in ix86_expand_fp_movcc() can be disabled without
affecting the problem.
(following is a patch that disables failure according to comment #2, but enables
it again according to this comment):
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.787
diff -u -p -r1.787 i386.c
--- i386.c 20 Jan 2005 18:34:11 -0000 1.787
+++ i386.c 21 Jan 2005 06:40:22 -0000
@@ -8470,6 +8470,8 @@ ix86_fp_comparison_codes (enum rtx_code
case LT: /* LTU - CF=1 - fails on unordered */
*first_code = UNLT;
*bypass_code = UNORDERED;
+ return;
+
break;
case LE: /* LEU - CF=1 | ZF=1 - fails on unordered */
*first_code = UNLE;
@@ -8549,6 +8551,11 @@ ix86_fp_comparison_fcomi_cost (enum rtx_
if (!TARGET_CMOVE)
return 1024;
ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code);
+
+ // ENABLE FAILURE
+ if ((code == LT) && !TARGET_IEEE_FP)
+ bypass_code = UNKNOWN;
+
return (bypass_code != UNKNOWN || second_code != UNKNOWN) + 2;
}
@@ -8605,6 +8612,8 @@ ix86_expand_fp_compare (enum rtx_code co
*bypass_test = NULL_RTX;
ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code);
+ // if ((code == LT) && !TARGET_IEEE_FP)
+ // bypass_code = UNKNOWN;
/* Do fcomi/sahf based test when profitable. */
if ((bypass_code == UNKNOWN || bypass_test)
@@ -8801,6 +8810,9 @@ ix86_fp_jump_nontrivial_p (enum rtx_code
if (!TARGET_CMOVE)
return true;
ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code);
+ // if ((code == LT) && !TARGET_IEEE_FP)
+ // bypass_code = UNKNOWN;
+
return bypass_code != UNKNOWN || second_code != UNKNOWN;
}
@@ -8835,6 +8847,10 @@ ix86_expand_branch (enum rtx_code code,
ix86_fp_comparison_codes (code, &bypass_code, &first_code,
&second_code);
+ //ENABLE FAILURE
+ if ((code == LT) && !TARGET_IEEE_FP)
+ bypass_code = UNKNOWN;
+
/* Check whether we will use the natural sequence with one jump. If
so, we can expand jump early. Otherwise delay expansion by
creating compound insn to not confuse optimizers. */
@@ -9767,7 +9783,7 @@ ix86_expand_fp_movcc (rtx operands[])
enum rtx_code code = GET_CODE (operands[1]);
rtx tmp, compare_op, second_test, bypass_test;
- if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode))
+ if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode) && 0)
{
rtx cmp_op0, cmp_op1, if_true, if_false;
rtx clob;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19506