From 75d045c2630eeaeabfa3cc82d9ca8f82da0671a2 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 17 May 2001 17:40:48 +0000 Subject: * simplify-rtx.c (simplify_subreg): Avoid creating of incorrect subregs. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@42212 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/simplify-rtx.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b256242e0ee..4087617124c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Thu May 17 19:40:03 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Avoid creating of incorrect subregs. + 2001-05-17 Bernd Schmidt * expr.c (protect_from_queue): Protect against subsequent calls to diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 44cfc3b7e32..fd1b6303768 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)), -- cgit v1.2.3