Commit acfb3980 by Raksit Ashok Committed by Raksit Ashok

re PR target/27971 (eliminate shift in array[(x>>2)&3])

gcc/ChangeLog
       PR rtl-optimization/27971
       * combine.c (find_split_point): introduced a new split for certain
       types of mem rtx.

gcc/testsuite/ChangeLog

       PR rtl-optimization/27971
       * gcc.target/i386/pr27971.c: New testcase.

From-SVN: r131460
parent 3fa87ef8
2008-01-10 Raksit Ashok <raksit@google.com>
PR rtl-optimization/27971
* combine.c (find_split_point): introduced a new split for certain
types of mem rtx.
2008-01-10 DJ Delorie <dj@redhat.com>
* config/m32c/m32c.c (m32c_hard_regno_nregs_1): Renamed from...
......@@ -3967,6 +3967,15 @@ find_split_point (rtx *loc, rtx insn)
&& OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
return &XEXP (XEXP (x, 0), 0);
}
/* If we have a PLUS whose first operand is complex, try computing it
separately by making a split there. */
if (GET_CODE (XEXP (x, 0)) == PLUS
&& ! memory_address_p (GET_MODE (x), XEXP (x, 0))
&& ! OBJECT_P (XEXP (XEXP (x, 0), 0))
&& ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG
&& OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
return &XEXP (XEXP (x, 0), 0);
break;
case SET:
......
2008-01-10 Raksit Ashok <raksit@google.com>
PR rtl-optimization/27971
* gcc.target/i386/pr27971.c: New testcase.
2008-01-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34396
/* { dg-do compile } */
/* { dg-options "-O2" } */
unsigned array[4];
unsigned foo(unsigned long x)
{
return array[(x>>2)&3ul];
}
/* { dg-final { scan-assembler-not "shr\[^\\n\]*2" } } */
/* { dg-final { scan-assembler "and\[^\\n\]*12" } } */
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