This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/80693] [6/7/8 Regression] wrong code with -O -fno-tree-coalesce-vars
- From: "mikpelinux at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Aug 2017 09:05:51 +0000
- Subject: [Bug rtl-optimization/80693] [6/7/8 Regression] wrong code with -O -fno-tree-coalesce-vars
- Auto-submitted: auto-generated
- References: <bug-80693-4@http.gcc.gnu.org/bugzilla/>
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.