aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2012-11-19 23:28:04 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2012-11-19 23:28:04 +0000
commit0343822bd86552c0264836a6d6f0927bf39c87b1 (patch)
tree93122eaac614328a2889483eabeeb9a843d1337d /gcc/simplify-rtx.c
parent0e8330d91d13ed0200ef902c596d349ab1969d19 (diff)
downloadgcc-0343822bd86552c0264836a6d6f0927bf39c87b1.zip
gcc-0343822bd86552c0264836a6d6f0927bf39c87b1.tar.gz
gcc-0343822bd86552c0264836a6d6f0927bf39c87b1.tar.bz2
re PR middle-end/55359 (ICE in simplify_subreg accessing an unaligned subvector)
gcc/ PR middle-end/55359 * simplify-rtx.c (simplify_subreg): Return null for invalid offsets. gcc/testsuite/ * gcc.target/i386/pr55359.c: New test. From-SVN: r193640
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 18223a8..46d9e8a 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -5685,8 +5685,11 @@ simplify_subreg (enum machine_mode outermode, rtx op,
gcc_assert (GET_MODE (op) == innermode
|| GET_MODE (op) == VOIDmode);
- gcc_assert ((byte % GET_MODE_SIZE (outermode)) == 0);
- gcc_assert (byte < GET_MODE_SIZE (innermode));
+ if ((byte % GET_MODE_SIZE (outermode)) != 0)
+ return NULL_RTX;
+
+ if (byte >= GET_MODE_SIZE (innermode))
+ return NULL_RTX;
if (outermode == innermode && !byte)
return op;