aboutsummaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-09-11 09:33:23 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-09-11 09:33:23 +0200
commitd898d29bf9d642a49bb2502416ecdfe0a21d6ac1 (patch)
tree654aa05676a650f4bfb708a7c200e82d0a1e39c8 /gcc/dse.c
parentace428e3133f0aa7f4cb90180e716114bf73d705 (diff)
downloadgcc-d898d29bf9d642a49bb2502416ecdfe0a21d6ac1.zip
gcc-d898d29bf9d642a49bb2502416ecdfe0a21d6ac1.tar.gz
gcc-d898d29bf9d642a49bb2502416ecdfe0a21d6ac1.tar.bz2
re PR target/37382 (ICE in extract_insn: <var_decl 0x7fda26ff4b40 swig_module>) 0))
PR target/37382 * expmed.c (extract_low_bits): Avoid creating invalid subregs. * dse.c (find_shift_sequence): Use extract_low_bits instead of simplify_gen_subreg. * gcc.c-torture/compile/pr37382.c: New test. From-SVN: r140265
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index 7283bbe..0a3ebb4 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1445,7 +1445,7 @@ find_shift_sequence (int access_size,
new_mode = GET_MODE_WIDER_MODE (new_mode))
{
rtx target, new_reg, shift_seq, insn, new_lhs;
- int cost, offset;
+ int cost;
/* Try a wider mode if truncating the store mode to NEW_MODE
requires a real instruction. */
@@ -1459,11 +1459,6 @@ find_shift_sequence (int access_size,
if (!CONSTANT_P (store_info->rhs)
&& !MODES_TIEABLE_P (new_mode, store_mode))
continue;
- offset = subreg_lowpart_offset (new_mode, store_mode);
- new_lhs = simplify_gen_subreg (new_mode, copy_rtx (store_info->rhs),
- store_mode, offset);
- if (new_lhs == NULL_RTX)
- continue;
new_reg = gen_reg_rtx (new_mode);
@@ -1496,6 +1491,11 @@ find_shift_sequence (int access_size,
if (cost > COSTS_N_INSNS (1))
continue;
+ new_lhs = extract_low_bits (new_mode, store_mode,
+ copy_rtx (store_info->rhs));
+ if (new_lhs == NULL_RTX)
+ continue;
+
/* We found an acceptable shift. Generate a move to
take the value from the store and put it into the
shift pseudo, then shift it, then generate another