Commit 154516d9 by Wei Guozhi Committed by Wei Guozhi

re PR rtl-optimization/49799 (gcc arm generates illegal sbfx instruction)

	PR rtl-optimization/49799

	* combine.c (make_compound_operation): Check if the bit field is valid
	before change it to bit field extraction.

	* gcc.dg/pr49799.c: New test case.

From-SVN: r176911
parent 4bd1d898
2011-07-29 Wei Guozhi <carrot@google.com>
PR rtl-optimization/49799
* combine.c (make_compound_operation): Check if the bit field is valid
before change it to bit field extraction.
2011-07-29 Bernd Schmidt <bernds@codesourcery.com>
PR rtl-optimization/49891
......
......@@ -7787,6 +7787,7 @@ make_compound_operation (rtx x, enum rtx_code in_code)
&& GET_CODE (lhs) == ASHIFT
&& CONST_INT_P (XEXP (lhs, 1))
&& INTVAL (rhs) >= INTVAL (XEXP (lhs, 1))
&& INTVAL (XEXP (lhs, 1)) >= 0
&& INTVAL (rhs) < mode_width)
{
new_rtx = make_compound_operation (XEXP (lhs, 0), next_code);
......
2011-07-29 Wei Guozhi <carrot@google.com>
PR rtl-optimization/49799
* gcc.dg/pr49799.c: New test case.
2011-07-22 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/48648
......
/* PR rtl-optimization/49799 */
/* { dg-do assemble } */
/* { dg-options "-O2 -w" } */
static __inline int bar(int a)
{
int tmp;
if (a <= 0) a ^= 0xFFFFFFFF;
return tmp - 1;
}
void foo(short *K)
{
short tmp;
short *pptr, P[14];
pptr = P;
tmp = bar(*K);
*pptr = (*K << tmp) >> 16;
if (*P < tmp)
*K++ = 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment