diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-05-22 21:00:00 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-05-22 21:00:00 +0200 |
commit | ccb1b17ba8e94c59bbf14f8ed24d9e39377b7efb (patch) | |
tree | f264700c2c973d12b362c40b9b641a0c3b6fe026 /gcc/expmed.c | |
parent | 50ad7db2a849954f37b412fbb466fcda2a655a38 (diff) | |
download | gcc-ccb1b17ba8e94c59bbf14f8ed24d9e39377b7efb.zip gcc-ccb1b17ba8e94c59bbf14f8ed24d9e39377b7efb.tar.gz gcc-ccb1b17ba8e94c59bbf14f8ed24d9e39377b7efb.tar.bz2 |
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: r174034
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 18a6592..5527c1e 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1769,8 +1769,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. */ @@ -1782,6 +1780,9 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, break; } + if (mode != tmode) + target = 0; + if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos)) { int amount = GET_MODE_BITSIZE (mode) - (bitsize + bitpos); |