aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-05-17 19:40:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-05-17 17:40:48 +0000
commit8f7785933c54f04b205d43351907d2b1c93eea9a (patch)
treed52e05afdcdc9330a9c9b5016b521792970e08bb /gcc/simplify-rtx.c
parentb2040e7b55b41fcec68c984678a08fc0267ad3c7 (diff)
downloadgcc-8f7785933c54f04b205d43351907d2b1c93eea9a.zip
gcc-8f7785933c54f04b205d43351907d2b1c93eea9a.tar.gz
gcc-8f7785933c54f04b205d43351907d2b1c93eea9a.tar.bz2
* simplify-rtx.c (simplify_subreg): Avoid creating of incorrect subregs.
From-SVN: r42212
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 44cfc3b..fd1b630 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2331,6 +2331,10 @@ simplify_subreg (outermode, op, innermode, byte)
% UNITS_PER_WORD));
}
+ /* Bail out in case resulting subreg would be incorrect. */
+ if (final_offset % GET_MODE_SIZE (outermode)
+ || final_offset >= GET_MODE_SIZE (innermostmode))
+ return NULL;
/* Recurse for futher possible simplifications. */
new = simplify_subreg (outermode, SUBREG_REG (op),
GET_MODE (SUBREG_REG (op)),