Return VARYING in range_on_path_entry if nothing found.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 28 Sep 2021 07:38:50 +0000 (09:38 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 28 Sep 2021 09:11:20 +0000 (11:11 +0200)
commitfb8b72ebb5b0bf40f7dfef9154c42320ce46f2a7
tree081a7f87af777eb72e4a6dbca7006979193e69b1
parentdc614a838ecc33578e0903fec599fee6844680a7
Return VARYING in range_on_path_entry if nothing found.

The problem here is that the solver's code solving unknown SSAs on entry
to a path was returning UNDEFINED if there were no incoming edges to the
start of the path that were not the function entry block.  This caused a
cascade of pain down stream.

Tested on x86-64 Linux.

PR tree-optimization/102511

gcc/ChangeLog:

* gimple-range-path.cc (path_range_query::range_on_path_entry):
Return VARYING when nothing found.

gcc/testsuite/ChangeLog:

* gcc.dg/pr102511.c: New test.
* gcc.dg/tree-ssa/ssa-dom-thread-14.c: Adjust.
gcc/gimple-range-path.cc
gcc/testsuite/gcc.dg/pr102511.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c