https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80693
Mikael Pettersson <mikpelinux at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikpelinux at gmail dot com
--- Comment #5 from Mikael Pettersson <mikpelinux at gmail dot com> ---
(In reply to Alexandre Oliva from comment #2)
> Created attachment 41371 [details]
> patch I'm testing to fix the bug
>
> The problem is that combine creates a single insn with the AND and the
> compare, still modifying the same REG that is also an AND operand. Later,
> it combines that two-SETs insn with 2 other insns, an AND and a NOT,
> dropping the SET that modified the REG but still referencing the earlier
> value of that REG. Then, it attempts to combine the AND and the NOT, but
> since it still believes the REG held the result of an AND with 1, that
> simplifies to a XOR with 1. The problem is that the REG no longer holds the
> result of the AND, but combine failed to detach the REG from the value of
> the dropped SET. This patch does just that.
What's the status of this patch? It also appears to be fixing PR81019, so it'd
be nice to see it move forward.