On Sun, 5 Jul 2015, Eric Botcazou wrote: > > The following moves some bitwise patterns from the match-and-simplify > > branch, extending them with proper conditional converts and removing > > the corresponding patterns from fold-const.c > > There is a pasto/thinko in the last pattern: > > /* Convert ~X ^ C to X ^ ~C. */ > (simplify > (bit_xor (convert? (bit_not @0)) INTEGER_CST@1) > (bit_xor (convert @0) (bit_not @1))) > > That's incorrect if the types don't have the same precision, as in the other > cases, and is responsible for PR tree-optimization/66757.
Hum, somehow I convinced myself that it was ok if the precision wasn't the same (but I can't remember my line of thought). Your testcase clearly shows I was wrong ;) > Tested on x86_64-suse-linux, OK for the mainline? Ok. Thanks, Richard. > > 2015-07-05 Eric Botcazou <ebotca...@adacore.com> > > PR tree-optimization/66757 > * match.pd: Add missing condition to ~X ^ C -> X ^ ~C. > > 2015-07-05 Eric Botcazou <ebotca...@adacore.com> > > * gcc.c-torture/execute/pr66757.c: New test. > > -- Richard Biener <rguent...@suse.de> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg)