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 | |
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')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lra-eliminations.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr69071.c | 22 |
4 files changed, 39 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5936b42..3d05c57 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-01-11 Jakub Jelinek <jakub@redhat.com> + 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. + * fold-const.c (fold_convertible_p): Don't return true for conversion of VECTOR_TYPE to same sized integral type. (fold_convert_loc): Fix up formatting. Fold conversion of 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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9e9423b..aeea559 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-01-11 Jakub Jelinek <jakub@redhat.com> + PR target/69071 + * gcc.dg/pr69071.c: New test. + PR c++/69211 * g++.dg/opt/pr69211.C: New test. diff --git a/gcc/testsuite/gcc.dg/pr69071.c b/gcc/testsuite/gcc.dg/pr69071.c new file mode 100644 index 0000000..1a17a94 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69071.c @@ -0,0 +1,22 @@ +/* PR target/69071 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +void *bar (void *); + +void +foo (int c) +{ + unsigned char bf[65400]; + unsigned char *p2 = bar (bf); + unsigned char *p3 = bar (bf); + for (; *p2; p2++, c++) + { + if (c) + { + short of = p2 - bf - 6; + unsigned ofu = of; + __builtin_memcpy (p3, &ofu, sizeof (ofu)); + } + } +} |