summaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-05-22 21:02:59 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-05-22 21:02:59 +0200
commitbba3a46ec2abdcf42113873f1c990ffcd869ddc3 (patch)
tree6f3e5930c61bd6265fca63c7ef9d5f2305cfc8bb /gcc/expmed.c
parent603057618384112ca847168c9bcc63fb1b9ac31e (diff)
downloadgcc-bba3a46ec2abdcf42113873f1c990ffcd869ddc3.tar.gz
re PR middle-end/49029 (ICE in simplify_subreg, at simplify-rtx.c:5266)
PR middle-end/49029 * expmed.c (extract_fixed_bit_field): Test whether target can be used only after deciding which mode to use. * gcc.c-torture/compile/pr49029.c: New test. From-SVN: r174036
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 6c35f8eb4b4..0d44b2b4d54 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -1875,8 +1875,6 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
/* To extract a signed bit-field, first shift its msb to the msb of the word,
then arithmetic-shift its lsb to the lsb of the word. */
op0 = force_reg (mode, op0);
- if (mode != tmode)
- target = 0;
/* Find the narrowest integer mode that contains the field. */
@@ -1888,6 +1886,9 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
break;
}
+ if (mode != tmode)
+ target = 0;
+
if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos))
{
tree amount