From: Uros Bizjak Date: Wed, 16 Apr 2008 15:53:59 +0000 (+0200) Subject: re PR target/35944 (wrong result for MOD with kind=10 for some array argument values) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17c340e049b6cd5e282a020e484b789c678cbd39;p=gcc.git re PR target/35944 (wrong result for MOD with kind=10 for some array argument values) PR target/35944 * config/i386/i386.md (fmodxf3): Copy operand 1 and operand 2 into temporary registers. Change operand predicate to general_operand. (remainderxf3): Ditto. From-SVN: r134348 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a36a14accd5..ea8fb4dc670 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-04-16 Uros Bizjak + + PR target/35944 + * config/i386/i386.md (fmodxf3): Copy operand 1 and operand 2 into + temporary registers. Change operand predicate to general_operand. + (remainderxf3): Ditto. + 2008-04-16 Richard Guenther * Makefile.in (tree-affine.o): Add $(FLAGS_H) dependency. @@ -51,9 +58,9 @@ sjlj_build_landing_pads, finish_eh_generation, remove_exception_handler_label, remove_eh_handler, maybe_remove_eh_handler, add_reachable_handler, - reachable_handlers, expand_builtin_eh_return, - expand_eh_return, add_action_record, collect_one_action_chain, - add_call_site, convert_to_eh_region_ranges, sjlj_size_of_call_site_table, + reachable_handlers, expand_builtin_eh_return, expand_eh_return, + add_action_record, collect_one_action_chain, add_call_site, + convert_to_eh_region_ranges, sjlj_size_of_call_site_table, sjlj_output_call_site_table, output_function_exception_table, * except.h (note_current_region_may_contain_throw): Remove (get_exception_pointer, get_exception_filter): Do not take struct diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index d428c3b58d9..d09eb260f4e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -16434,28 +16434,24 @@ (define_expand "fmodxf3" [(use (match_operand:XF 0 "register_operand" "")) - (use (match_operand:XF 1 "register_operand" "")) - (use (match_operand:XF 2 "register_operand" ""))] + (use (match_operand:XF 1 "general_operand" "")) + (use (match_operand:XF 2 "general_operand" ""))] "TARGET_USE_FANCY_MATH_387" { rtx label = gen_label_rtx (); - rtx op2; + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); - if (rtx_equal_p (operands[1], operands[2])) - { - op2 = gen_reg_rtx (XFmode); - emit_move_insn (op2, operands[2]); - } - else - op2 = operands[2]; + emit_move_insn (op1, operands[1]); + emit_move_insn (op2, operands[2]); emit_label (label); - emit_insn (gen_fpremxf4_i387 (operands[1], op2, operands[1], op2)); + emit_insn (gen_fpremxf4_i387 (op1, op2, op1, op2)); ix86_emit_fp_unordered_jump (label); LABEL_NUSES (label) = 1; - emit_move_insn (operands[0], operands[1]); + emit_move_insn (operands[0], op1); DONE; }) @@ -16506,28 +16502,24 @@ (define_expand "remainderxf3" [(use (match_operand:XF 0 "register_operand" "")) - (use (match_operand:XF 1 "register_operand" "")) - (use (match_operand:XF 2 "register_operand" ""))] + (use (match_operand:XF 1 "general_operand" "")) + (use (match_operand:XF 2 "general_operand" ""))] "TARGET_USE_FANCY_MATH_387" { rtx label = gen_label_rtx (); - rtx op2; + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); - if (rtx_equal_p (operands[1], operands[2])) - { - op2 = gen_reg_rtx (XFmode); - emit_move_insn (op2, operands[2]); - } - else - op2 = operands[2]; + emit_move_insn (op1, operands[1]); + emit_move_insn (op2, operands[2]); emit_label (label); - emit_insn (gen_fprem1xf4_i387 (operands[1], op2, operands[1], op2)); + emit_insn (gen_fprem1xf4_i387 (op1, op2, op1, op2)); ix86_emit_fp_unordered_jump (label); LABEL_NUSES (label) = 1; - emit_move_insn (operands[0], operands[1]); + emit_move_insn (operands[0], op1); DONE; })