Re: [PATCH] PR tree-optimization/101403: Incorrect folding of ((T)bswap(x))>>C

2021-07-12 Thread Jakub Jelinek via Gcc-patches
On Sun, Jul 11, 2021 at 10:48:17AM +0100, Roger Sayle wrote: > /* { dg-do run } */ > /* { dg-options "-O2" } */ > unsigned int foo (unsigned int a) > { > unsigned int u; Can you please change the above line to unsigned int u = 0; or add some other initializer, or make it static unsigned int

Re: [PATCH] PR tree-optimization/101403: Incorrect folding of ((T)bswap(x))>>C

2021-07-11 Thread Richard Biener via Gcc-patches
On Sun, Jul 11, 2021 at 11:48 AM Roger Sayle wrote: > > > My sincere apologies for the breakage. My recent patch to fold > bswapN(x)>>C where the constant C was large enough that the result > only contains bits from the low byte, and can therefore avoid > the byte swap contains a minor logic erro

[PATCH] PR tree-optimization/101403: Incorrect folding of ((T)bswap(x))>>C

2021-07-11 Thread Roger Sayle
My sincere apologies for the breakage. My recent patch to fold bswapN(x)>>C where the constant C was large enough that the result only contains bits from the low byte, and can therefore avoid the byte swap contains a minor logic error. The pattern contains a convert? allowing an extension to occ