This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48908] [4.7 Regression]: build fails on cris-elf in libiberty:md5.c, shift-related
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 6 May 2011 09:22:24 +0000
- Subject: [Bug middle-end/48908] [4.7 Regression]: build fails on cris-elf in libiberty:md5.c, shift-related
- Auto-submitted: auto-generated
- References: <bug-48908-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48908
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-06 09:19:38 UTC ---
Ok, so
other_amount
= simplify_gen_binary (MINUS, GET_MODE (op1),
GEN_INT (GET_MODE_BITSIZE (mode)),
op1);
does not constant fold!? Oh.
The following fixes the ICE for me:
Index: expmed.c
===================================================================
--- expmed.c (revision 173473)
+++ expmed.c (working copy)
@@ -2141,9 +2141,12 @@ expand_shift_1 (enum tree_code code, enu
rtx new_amount, other_amount;
rtx temp1;
+ op1_mode = GET_MODE (op1);
+ if (op1_mode == VOIDmode)
+ op1_mode = word_mode;
new_amount = op1;
other_amount
- = simplify_gen_binary (MINUS, GET_MODE (op1),
+ = simplify_gen_binary (MINUS, op1_mode,
GEN_INT (GET_MODE_BITSIZE (mode)),
op1);
or, other variant, side-stepping the issue:
Index: expmed.c
===================================================================
--- expmed.c (revision 173473)
+++ expmed.c (working copy)
@@ -2141,11 +2141,16 @@ expand_shift_1 (enum tree_code code, enu
rtx new_amount, other_amount;
rtx temp1;
+ op1_mode = GET_MODE (op1);
new_amount = op1;
- other_amount
- = simplify_gen_binary (MINUS, GET_MODE (op1),
- GEN_INT (GET_MODE_BITSIZE (mode)),
- op1);
+ if (op1_mode == VOIDmode)
+ other_amount = GEN_INT (GET_MODE_BITSIZE (mode)
+ - INTVAL (op1));
+ else
+ other_amount
+ = simplify_gen_binary (MINUS, op1_mode,
+ GEN_INT (GET_MODE_BITSIZE (mode)),
+ op1);
shifted = force_reg (mode, shifted);