]> git.ipfire.org Git - people/ms/gcc.git/commit
tree-optimization/107937 - uninit predicate simplification fixup
authorRichard Biener <rguenther@suse.de>
Thu, 1 Dec 2022 09:12:28 +0000 (10:12 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 1 Dec 2022 09:53:41 +0000 (10:53 +0100)
commitabf05583dbc86a6667b63f5bda6ba57fe55a1b25
treebefc2c277eb2254a84124f509c76f41e20567281
parent8629f212af0acb113879d0bc45291c54743790f1
tree-optimization/107937 - uninit predicate simplification fixup

The following changes the predicate representation to record the
value of a predicate with an empty set of AND predicates.  That's
necessary to properly represent the conservative fallback for the
def vs use predicates.  Since simplification now can result in
such an empty set this distinction becomes important and we need
to check for this as we otherwise ICE.

PR tree-optimization/107937
* gimple-predicate-analysis.h (predicate::is_true): New.
(predicate::is_false): Likewise.
(predicate::empty_val): Likewise.
(uninit_analysis::uninit_analysis): Properly initialize
def_preds.
* gimple-predicate-analysis.cc (simplify_1b): Indicate
whether the chain became empty.
(predicate::simplify): Release emptied chain before removing it.
(predicate::normalize): Replace temporary object with assertion.
(uninit_analysis::is_use_guarded): Deal with predicates
that simplify to true/false.

* gcc.dg/pr107937.c: New testcase.
gcc/gimple-predicate-analysis.cc
gcc/gimple-predicate-analysis.h
gcc/testsuite/gcc.dg/pr107937.c [new file with mode: 0644]