backport: re PR rtl-optimization/40861 (ICE in simplify_subreg, at simplify-rtx.c:4981)

Backport from mainline:
	2009-08-27  Uros Bizjak  <ubizjak@gmail.com>

	PR rtl-optimization/40861
	* simplify-rtx.c (simplify_subreg): Do not call simplify_gen_subreg to
	extract word from a multi-word subreg for negative byte positions.

testsuite/ChangeLog:

	Backport from mainline:
	2009-08-27  Uros Bizjak  <ubizjak@gmail.com>

	PR rtl-optimization/40861
	* gcc.dg/pr40861.c: New test.

From-SVN: r151489
This commit is contained in:
Uros Bizjak 2009-09-07 22:25:52 +02:00 committed by Uros Bizjak
parent b04e3391f5
commit 217d1d0a22
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2009-09-07 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
2009-08-27 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/40861
* simplify-rtx.c (simplify_subreg): Do not call simplify_gen_subreg to
extract word from a multi-word subreg for negative byte positions.
2009-09-04 Wolfgang Gellerich <gellerich@de.ibm.com>
* config/s390/2097.md: Removed two incorrect bypasses.

View File

@ -5244,6 +5244,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)) >= 0
&& INTVAL (XEXP (op, 1)) < GET_MODE_BITSIZE (innermode)
&& byte == subreg_lowpart_offset (outermode, innermode))
{

View File

@ -1,3 +1,11 @@
2009-09-07 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
2009-08-27 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/40861
* gcc.dg/pr40861.c: New test.
2009-09-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41258

View File

@ -0,0 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
int foo(int i)
{
return (1LL >> 128 * i) && i;
}