Re: [PATCH] Fix up handling of bool BIT_NOT_EXPRs in store-merging (PR tree-optimization/84982, take 2)

2018-03-21 Thread Richard Biener
On Wed, 21 Mar 2018, Jakub Jelinek wrote: > On Wed, Mar 21, 2018 at 09:20:40AM +0100, Richard Biener wrote: > > > + tree lhs = gimple_assign_lhs (info->stmt); > > > + if (TREE_CODE (TREE_TYPE (lhs)) == BOOLEAN_TYPE && info->bitsize > 1) > > > > So I'm slightly uncomfortable with keying this j

[PATCH] Fix up handling of bool BIT_NOT_EXPRs in store-merging (PR tree-optimization/84982, take 2)

2018-03-21 Thread Jakub Jelinek
On Wed, Mar 21, 2018 at 09:20:40AM +0100, Richard Biener wrote: > > + tree lhs = gimple_assign_lhs (info->stmt); > > + if (TREE_CODE (TREE_TYPE (lhs)) == BOOLEAN_TYPE && info->bitsize > 1) > > So I'm slightly uncomfortable with keying this just on BOOLEAN_TYPE. > Do you think anything woul

Re: [PATCH] Fix up handling of bool BIT_NOT_EXPRs in store-merging (PR tree-optimization/84982)

2018-03-21 Thread Richard Biener
On Tue, 20 Mar 2018, Jakub Jelinek wrote: > Hi! > > Boolean !x is often expanded as ^ 1, but store merging it actually merges > as ^ 255 (for 8-bit bool), which is incorrect. > > The following patch fixes it to do that ^ 1 instead. > > Bootstrapped/regtested on x86_64-linux and i686-linux and c

[PATCH] Fix up handling of bool BIT_NOT_EXPRs in store-merging (PR tree-optimization/84982)

2018-03-20 Thread Jakub Jelinek
Hi! Boolean !x is often expanded as ^ 1, but store merging it actually merges as ^ 255 (for 8-bit bool), which is incorrect. The following patch fixes it to do that ^ 1 instead. Bootstrapped/regtested on x86_64-linux and i686-linux and checked on the testcase with -> powerpc64-linux cross, ok fo