[Bug tree-optimization/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e
aldyh at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 7 12:17:02 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107172
--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> Started with r13-1268-g8c99e307b20c502e.
Disabling DOM with -fno-tree-dominator-opts still causes the crash, so it's not
this patch that caused the problem. Furthermore, the IL at the *.optimized
dump looks fine, so this may be an RTL problem. I also disabled VRP's
exporting of global ranges to make sure it's not RTL-land making decisions
based on global SSA ranges.
Also, the revision before r13-1268-g8c99e307b20c502e also fails with
-fno-tree-dominator-opts -O1 -ftree-vrp.
I tried bisecting this further with -fno-tree-dominator-opts -O1 -ftree-vrp,
and ran into:
commit f1652e3343b1ec47035370801d9b9aca1f8b613f
Author: Roger Sayle <roger@nextmovesoftware.com>
Date: Mon May 30 21:26:37 2022 +0100
PR rtl-optimization/101617: Use neg/sbb in ix86_expand_int_movcc.
This patch resolves PR rtl-optimization/101617 where we should generate
the exact same code for (X ? -1 : 1) as we do for ((X ? -1 : 0) | 1).
The cause of the current difference on x86_64 is actually in
ix86_expand_int_movcc that doesn't know that negl;sbbl can be used
to create a -1/0 result depending on whether the input is zero/nonzero.
More information about the Gcc-bugs
mailing list