]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/97953 - fix bougs range recorded by EVRP
authorRichard Biener <rguenther@suse.de>
Thu, 26 Nov 2020 15:13:08 +0000 (16:13 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 12 Jan 2022 08:21:20 +0000 (09:21 +0100)
commitd4e5ca668498a41af6417721be2ec69b2eac062e
tree71c0e59592d3f5963e4244e1406243907de1cb66
parentf9d102e07b0883a55144fb2cfbef0113ace08b9b
tree-optimization/97953 - fix bougs range recorded by EVRP

EVRP records some ranges from asserts into SSA_NAME_RANGE_INFO
but fails to assert that the condition the range is derived from
is always true after the SSA names definition.  The patch implements
the simplest post-dominance check, basic-block equality.

2020-11-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97953
* gimple-ssa-evrp-analyze.c
(evrp_range_analyzer::record_ranges_from_incoming_edge): Make
sure the condition post-dominates the SSA definition before
recording into SSA_NAME_RANGE_INFO.

* gcc.dg/pr97953.c: New testcase.

(cherry picked from commit c76b3f9e83353a4cd437ca137c1fb835c9b5c21f)
gcc/gimple-ssa-evrp-analyze.c
gcc/testsuite/gcc.dg/pr97953.c [new file with mode: 0644]