]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/107919 - predicate simplification in uninit
authorRichard Biener <rguenther@suse.de>
Wed, 30 Nov 2022 11:05:29 +0000 (12:05 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 30 Nov 2022 11:53:10 +0000 (12:53 +0100)
commitb628cad9e093f7a33042fb9dd647f183394eefae
treeaab9053ecb81a4c6fdc09abca18d26d55690a922
parent2792cb50f55529e1737461e032ed13e7f04f73d2
tree-optimization/107919 - predicate simplification in uninit

The testcase from the PR at -O2 shows

    ((_277 == 2) AND (_79 == 0))
    OR ((NOT (_277 == 0)) AND (NOT (_277 > 2)) AND (NOT (_277 == 2)) AND (_79 == 0))
    OR ((NOT (pretmp_300 == 255)) AND (_277 == 0) AND (NOT (_277 > 2)) AND (NOT (_277 == 2)) AND (_79 == 0))

which we fail to simplify.  The following patch makes us simplify
the relations on _277, producing

    ((_79 == 0) AND (_277 == 2))
    OR ((_79 == 0) AND (_277 <= 1) AND (NOT (_277 == 0)))
    OR ((_79 == 0) AND (_277 == 0) AND (NOT (pretmp_300 == 255)))

which might be an incremental step to resolve a bogus uninit
diagnostic at -O2.  The patch uses maybe_fold_and_comparison for this.

PR tree-optimization/107919
* gimple-predicate-analysis.cc (simplify_1): Rename to ...
(simplify_1a): .. this.
(simplify_1b): New.
(predicate::simplify): Call both simplify_1a and simplify_1b.
gcc/gimple-predicate-analysis.cc
This page took 0.065091 seconds and 6 git commands to generate.