diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-08-30 08:45:56 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-08-30 08:45:56 +0200 |
commit | 26122e2d8a1aa5e8ea91f7df94513cde1e2de509 (patch) | |
tree | 7e28037ad6ece73174d26d1748b4aa22362f6048 /gcc/simplify-rtx.c | |
parent | ab8348325fede96edbd63fdc233173682c8496d5 (diff) | |
download | gcc-26122e2d8a1aa5e8ea91f7df94513cde1e2de509.zip gcc-26122e2d8a1aa5e8ea91f7df94513cde1e2de509.tar.gz gcc-26122e2d8a1aa5e8ea91f7df94513cde1e2de509.tar.bz2 |
re PR middle-end/77377 (c-c++-common/pr59037.c ICEs with -fpic -msse on i686)
PR middle-end/77377
* simplify-rtx.c (avoid_constant_pool_reference): For out of bounds
constant pool reference return x instead of c.
* gcc.target/i386/pr77377.c: New test.
From-SVN: r239854
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 2085b99..8daef97 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -251,15 +251,14 @@ avoid_constant_pool_reference (rtx x) /* If we're accessing the constant in a different mode than it was originally stored, attempt to fix that up via subreg simplifications. If that fails we have no choice but to return the original memory. */ - if ((offset != 0 || cmode != GET_MODE (x)) - && offset >= 0 && offset < GET_MODE_SIZE (cmode)) + if (offset == 0 && cmode == GET_MODE (x)) + return c; + else if (offset >= 0 && offset < GET_MODE_SIZE (cmode)) { rtx tem = simplify_subreg (GET_MODE (x), c, cmode, offset); if (tem && CONSTANT_P (tem)) return tem; } - else - return c; } return x; |