------- Comment #4 from ubizjak at gmail dot com 2009-08-27 17:19 -------
Patch in testing:
--cut here--
Index: simplify-rtx.c
===================================================================
--- simplify-rtx.c (revision 151142)
+++ simplify-rtx.c (working copy)
@@ -5263,6 +5263,7 @@ simplify_subreg (enum machine_mode outer
&& GET_MODE_BITSIZE (innermode) >= (2 * GET_MODE_BITSIZE (outermode))
&& CONST_INT_P (XEXP (op, 1))
&& (INTVAL (XEXP (op, 1)) & (GET_MODE_BITSIZE (outermode) - 1)) == 0
+ && INTVAL (XEXP (op, 1)) >= 0
&& INTVAL (XEXP (op, 1)) < GET_MODE_BITSIZE (innermode)
&& byte == subreg_lowpart_offset (outermode, innermode))
{
--cut here--
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40861