* simplify-rtx.c (simplify_subreg): Avoid creating of incorrect subregs.
authorJan Hubicka <jh@suse.cz>
Thu, 17 May 2001 17:40:48 +0000 (19:40 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 17 May 2001 17:40:48 +0000 (17:40 +0000)
From-SVN: r42212

gcc/ChangeLog
gcc/simplify-rtx.c

index b256242e0ee909b6380289ec9b7f1126be34ea21..4087617124ca8c2eb1b0533f057fd19952c86cc2 100644 (file)
@@ -1,3 +1,7 @@
+Thu May 17 19:40:03 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * simplify-rtx.c  (simplify_subreg): Avoid creating of incorrect subregs.
+
 2001-05-17  Bernd Schmidt  <bernds@redhat.com>
 
        * expr.c (protect_from_queue): Protect against subsequent calls to
index 44cfc3b7e32bc0b7f84378c794800c363713f13d..fd1b6303768b3289621e6dd439ab189a3374448c 100644 (file)
@@ -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)),