This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix regression for missed combine opportunity





A regression was introduced when changes were made to canonicalize
XOR/MINUS signbit to PLUS signbit.  Code to combine an XOR feeding a
ZERO_EXTRACT was not recognizing the opportunity because the XOR was
canonicalized into a PLUS.

An example of what this fixes:

  if ((u & 16) == 0) ...


Old:
      xori 3,3,16
      andi. 0,3,16
      beq 0,.L2

New:
      andi. 0,3,16
      bne 0,.L2


Bootstrapped/regtested on powerpc64-unknown-linux-gnu with no new regressions.

OK for mainline?

-Pat




2004-10-15  Pat Haugen  <pthaugen@us.ibm.com>

      * simplify-rtx.c (mode_signbit_p): Externalize function...
      * rtl.h (mode_signbit_p): ... to here.
      * combine.c (simplify_shift_const): Recognize PLUS signbit as
      canonical form of XOR signbit and move to outer op.

(See attached file: patch.combine_xori)

Attachment: patch.combine_xori
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]