This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix do_jump_by_parts_zero_rtx (PR middle-end/38347)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Jan 2009 14:32:25 +0100
- Subject: [PATCH] Fix do_jump_by_parts_zero_rtx (PR middle-end/38347)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
When op0 is a CONST_INT, it has VOIDmode, so obviously operand_subword_force
ICEs. But exactly for this reason do_jump_by_parts_zero_rtx is called
also with the MODE argument. The only caller, do_jump_by_parts_equality_rtx,
also uses mode and not GET_MODE (op0) or GET_MODE (op1) for the last
argument in calls to operand_subword_force.
Bootstrapped/regtested on {x86_64,i686}-linux, ok for trunk?
2009-01-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/38347
* dojump.c (do_jump_by_parts_zero_rtx): Use mode instead of
GET_MODE (op0) in operand_subword_force calls.
--- gcc/dojump.c.jj 2008-10-23 13:21:39.000000000 +0200
+++ gcc/dojump.c 2009-01-09 11:10:40.000000000 +0100
@@ -675,10 +675,10 @@ do_jump_by_parts_zero_rtx (enum machine_
be slower, but that's highly unlikely. */
part = gen_reg_rtx (word_mode);
- emit_move_insn (part, operand_subword_force (op0, 0, GET_MODE (op0)));
+ emit_move_insn (part, operand_subword_force (op0, 0, mode));
for (i = 1; i < nwords && part != 0; i++)
part = expand_binop (word_mode, ior_optab, part,
- operand_subword_force (op0, i, GET_MODE (op0)),
+ operand_subword_force (op0, i, mode),
part, 1, OPTAB_WIDEN);
if (part != 0)
@@ -694,7 +694,7 @@ do_jump_by_parts_zero_rtx (enum machine_
drop_through_label = if_false_label = gen_label_rtx ();
for (i = 0; i < nwords; i++)
- do_compare_rtx_and_jump (operand_subword_force (op0, i, GET_MODE (op0)),
+ do_compare_rtx_and_jump (operand_subword_force (op0, i, mode),
const0_rtx, EQ, 1, word_mode, NULL_RTX,
if_false_label, NULL_RTX);
Jakub