[Bug tree-optimization/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e

2022-10-07 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107172

--- Comment #3 from Aldy Hernandez  ---
(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 
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.

[Bug tree-optimization/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e

2022-10-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107172

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug tree-optimization/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e

2022-10-06 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107172

Martin Liška  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
Summary|[13 Regression] wrong code  |[13 Regression] wrong code
   |with "-O1 -ftree-vrp" on|with "-O1 -ftree-vrp" on
   |x86_64-linux-gnu|x86_64-linux-gnu since
   ||r13-1268-g8c99e307b20c502e

--- Comment #2 from Martin Liška  ---
Started with r13-1268-g8c99e307b20c502e.