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 <ro...@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.

Reply via email to