------- Comment #12 from pinskia at gcc dot gnu dot org 2008-04-30 20:00 ------- (In reply to comment #11) > Still f4 looks weird (wrong-code?!) as we fold *p = ~*p to *p = (int) *p != > -1; > I'll open a PR for this.
We decided this was the correct thing as we start out with ~((int)*p) != 0 which then gets folded into (int)*p != -1 and then VRP comes around and says (int)*p can only be [0,1] so it gets folded into 1. Chris said the same thing in comment #2. So f4 is now fixed. In summary, we still have some issues though: f1: not fixed (at least on PPC): lbz 3,0(3) rlwinm 3,3,0,31,31 blr That mask should not be there. f2: fixed: f2: lbz 3,0(3) blr f3: fixed f3: lbz 0,0(3) xori 0,0,1 stb 0,0(3) blr f4: fixed, only a store of 1. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908