diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3fbaa29f93e..de089334244f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-06-09 Andy Hutchinson + + PR middle-end/36447 + * simplify-rtx.c (simplify_subreg): Add check for shift count + greater than size. + 2008-06-09 Richard Sandiford * doc/md.texi: Synchronize with later constraints.md change. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 15e4c2a3424f..262c91949373 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -5265,6 +5265,7 @@ simplify_subreg (enum machine_mode outermode, rtx op, && GET_MODE_BITSIZE (innermode) >= (2 * GET_MODE_BITSIZE (outermode)) && GET_CODE (XEXP (op, 1)) == CONST_INT && (INTVAL (XEXP (op, 1)) & (GET_MODE_BITSIZE (outermode) - 1)) == 0 + && INTVAL (XEXP (op, 1)) < GET_MODE_BITSIZE (innermode) && byte == subreg_lowpart_offset (outermode, innermode)) { int shifted_bytes = INTVAL (XEXP (op, 1)) / BITS_PER_UNIT;