-ffast-math -march=pentiumpro i386 fix
Jan Hubicka
hubicka@atrey.karlin.mff.cuni.cz
Fri Apr 28 03:12:00 GMT 2000
Hi
Current CVS crashes when compiling byte benchmark with -O3 -march=pentiumpro
-ffast-math. The purpose is that fcomi instruction is selected for compares
with memory operands.
Thu Apr 27 23:03:48 CEST 2000 Jan Hubicka <jh@suse.cz>
* i386.c (ix86_use_fcomi_compare): Make global.
* i386-protos.h (ix86_use_fcomi_compare): Declare.
* i386.md (fp comparison pattern): Use ix86_use_fcomi_compare.
*** i386.c.old Thu Apr 27 22:59:36 2000
--- i386.c Thu Apr 27 23:00:26 2000
*************** static void put_condition_code PARAMS ((
*** 392,398 ****
static enum rtx_code unsigned_comparison PARAMS ((enum rtx_code code));
static rtx ix86_expand_int_compare PARAMS ((enum rtx_code, rtx, rtx));
static enum machine_mode ix86_fp_compare_mode PARAMS ((enum rtx_code));
- static int ix86_use_fcomi_compare PARAMS ((enum rtx_code));
static enum rtx_code ix86_prepare_fp_compare_args PARAMS ((enum rtx_code,
rtx *, rtx *));
static rtx ix86_expand_compare PARAMS ((enum rtx_code));
--- 392,397 ----
*************** ix86_fp_compare_mode (code)
*** 4481,4487 ****
/* Return true if we should use an FCOMI instruction for this fp comparison. */
! static int
ix86_use_fcomi_compare (code)
enum rtx_code code;
{
--- 4480,4486 ----
/* Return true if we should use an FCOMI instruction for this fp comparison. */
! int
ix86_use_fcomi_compare (code)
enum rtx_code code;
{
*** i386-protos.h.old Thu Apr 27 22:59:41 2000
--- i386-protos.h Thu Apr 27 23:00:19 2000
*************** extern void ix86_split_ashldi PARAMS ((r
*** 108,113 ****
--- 108,114 ----
extern void ix86_split_ashrdi PARAMS ((rtx *, rtx));
extern void ix86_split_lshrdi PARAMS ((rtx *, rtx));
extern void ix86_expand_strlensi_unroll_1 PARAMS ((rtx, rtx, rtx));
+ extern int ix86_use_fcomi_compare PARAMS ((enum rtx_code));
extern rtx assign_386_stack_local PARAMS ((enum machine_mode, int));
extern int ix86_attr_length_default PARAMS ((rtx));
*** i386.md.old Thu Apr 27 23:03:31 2000
--- i386.md Thu Apr 27 23:02:04 2000
***************
*** 7153,7159 ****
(clobber (match_scratch:HI 4 "=a"))]
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])"
"#")
(define_insn "*fp_jcc_4"
--- 7153,7160 ----
(clobber (match_scratch:HI 4 "=a"))]
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])
! && !ix86_use_fcomi_compare (GET_CODE (operands[0]))"
"#")
(define_insn "*fp_jcc_4"
***************
*** 7168,7174 ****
(clobber (match_scratch:HI 4 "=a"))]
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])"
"#")
(define_insn "*fp_jcc_5"
--- 7169,7176 ----
(clobber (match_scratch:HI 4 "=a"))]
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])
! && !ix86_use_fcomi_compare (GET_CODE (operands[0]))"
"#")
(define_insn "*fp_jcc_5"
More information about the Gcc-patches
mailing list