This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, i386]: Committed: Fix PR tartge/33483, ICE in cselib_record_set, at cselib.c:1515 on x86
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Sep 2007 21:17:10 +0200
- Subject: [PATCH, i386]: Committed: Fix PR tartge/33483, ICE in cselib_record_set, at cselib.c:1515 on x86
Hello!
The problem here was, that when operands[1] == operands[2], CSElib got
confused by parallel RTX that outputs twice into the same pseudo. The
fix is to simply copy operand[2] into temporary register in this case.
Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu.
Patch is committed to mainline SVN.
2007-09-14 Uros Bizjak <ubizjak@gmail.com>
PR target/33438
* config/i386/i386.md (fmodxf3): Copy operands[2] to temporary
register
when operands[2] equals operands[1].
(remainderxf3): Ditto.
testsuite/ChangeLog:
2007-09-14 Uros Bizjak <ubizjak@gmail.com>
PR target/33438
* gcc.target/i386/pr33438.c: New test.
Uros.
Index: i386.md
===================================================================
--- i386.md (revision 128495)
+++ i386.md (working copy)
@@ -16691,10 +16691,18 @@
{
rtx label = gen_label_rtx ();
+ rtx op2;
+
+ if (rtx_equal_p (operands[1], operands[2]))
+ {
+ op2 = gen_reg_rtx (XFmode);
+ emit_move_insn (op2, operands[2]);
+ }
+ else
+ op2 = operands[2];
+
emit_label (label);
-
- emit_insn (gen_fpremxf4_i387 (operands[1], operands[2],
- operands[1], operands[2]));
+ emit_insn (gen_fpremxf4_i387 (operands[1], op2, operands[1], op2));
ix86_emit_fp_unordered_jump (label);
LABEL_NUSES (label) = 1;
@@ -16755,10 +16763,18 @@
{
rtx label = gen_label_rtx ();
+ rtx op2;
+
+ if (rtx_equal_p (operands[1], operands[2]))
+ {
+ op2 = gen_reg_rtx (XFmode);
+ emit_move_insn (op2, operands[2]);
+ }
+ else
+ op2 = operands[2];
+
emit_label (label);
-
- emit_insn (gen_fprem1xf4_i387 (operands[1], operands[2],
- operands[1], operands[2]));
+ emit_insn (gen_fprem1xf4_i387 (operands[1], op2, operands[1], op2));
ix86_emit_fp_unordered_jump (label);
LABEL_NUSES (label) = 1;