diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-01-11 20:06:34 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-11 20:06:34 +0100 |
commit | 26ff85b0b9d79cbea0b75e727526d0dfbd4ec5dc (patch) | |
tree | 5195e2fe60e188551679f4ead3dad46223f49e16 /gcc/lra-eliminations.c | |
parent | 655441d6015134c86c596ba28d079eb6c43b64bf (diff) | |
download | gcc-26ff85b0b9d79cbea0b75e727526d0dfbd4ec5dc.zip gcc-26ff85b0b9d79cbea0b75e727526d0dfbd4ec5dc.tar.gz gcc-26ff85b0b9d79cbea0b75e727526d0dfbd4ec5dc.tar.bz2 |
re PR target/69071 (ICE: in decompose, at rtl.h:2107 with -g)
PR target/69071
* lra-eliminations.c (move_plus_up): Only move plus up
if subreg of the constant can be simplified into constant
and use the simplified subreg of the constant instead of
the original constant.
* gcc.dg/pr69071.c: New test.
From-SVN: r232241
Diffstat (limited to 'gcc/lra-eliminations.c')
-rw-r--r-- | gcc/lra-eliminations.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c index ec9d7b7..99d5c6f 100644 --- a/gcc/lra-eliminations.c +++ b/gcc/lra-eliminations.c @@ -296,9 +296,14 @@ move_plus_up (rtx x) if (GET_CODE (x) == SUBREG && GET_CODE (subreg_reg) == PLUS && GET_MODE_SIZE (x_mode) <= GET_MODE_SIZE (subreg_reg_mode) && CONSTANT_P (XEXP (subreg_reg, 1))) - return gen_rtx_PLUS (x_mode, lowpart_subreg (x_mode, subreg_reg, - subreg_reg_mode), - XEXP (subreg_reg, 1)); + { + rtx cst = simplify_subreg (x_mode, XEXP (subreg_reg, 1), subreg_reg_mode, + subreg_lowpart_offset (x_mode, + subreg_reg_mode)); + if (cst && CONSTANT_P (cst)) + return gen_rtx_PLUS (x_mode, lowpart_subreg (x_mode, subreg_reg, + subreg_reg_mode), cst); + } return x; } |