aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2008-04-16 17:53:59 +0200
committerUros Bizjak <uros@gcc.gnu.org>2008-04-16 17:53:59 +0200
commit17c340e049b6cd5e282a020e484b789c678cbd39 (patch)
tree59ab59af18390a6f41d3c6d19d6f23b996d14964
parente544c850ffc63d95d704370f8ce5140b4d9e1c68 (diff)
downloadgcc-17c340e049b6cd5e282a020e484b789c678cbd39.zip
gcc-17c340e049b6cd5e282a020e484b789c678cbd39.tar.gz
gcc-17c340e049b6cd5e282a020e484b789c678cbd39.tar.bz2
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
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/i386/i386.md40
2 files changed, 26 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a36a14a..ea8fb4d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-16 Uros Bizjak <ubizjak@gmail.com>
+
+ 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 <rguenther@suse.de>
* 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 d428c3b..d09eb26 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;
})