On Wed, Jun 22, 2011 at 3:09 PM, Kai Tietz <ktiet...@googlemail.com> wrote: > Hello, > > This patch improves via type-sinking folding of binary and, or, and > xor operations. > First we do sinking also for compatible types with same precision, as > those don't need to be preserved for these operations. > Additional try to fold patterns (TYPE) X bin-op (Y CMP Z) and (TYPE) X > bin-op !Y, if type of X is > compatible to Y. > > ChangeLog gcc > > 2011-06-22 Kai Tietz <kti...@redhat.com> > > * tree-ssa-forwprop.c (simplify_bitwise_binary): > Improve binary folding regarding casts. > > > ChangeLog gcc/testsuite > > 2011-06-22 Kai Tietz <kti...@redhat.com> > > * gcc.dg/binop-notand1a.c: New test. > * gcc.dg/binop-notand2a.c: New test. > * gcc.dg/binop-notand3a.c: New test. > * gcc.dg/binop-notand4a.c: New test. > * gcc.dg/binop-notand5a.c: New test. > * gcc.dg/binop-notand6a.c: New test. > > Bootstrapped and regression tested for all standard languages, Ada, > and Obj-C++. Ok for apply?
The first hunk is ok, the 2nd not - please don't use fold here. Also your comment says what it tries to match, but not what it tries to produce. So - what is the transformation you are trying to do? The code is also two duplicates of exactly the same stuff. Btw, I see TRUTH_NOT_EXPR is still around, why's that so? Thanks, Richard. > Regards, > Kai >