]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/105142 - improve maybe_fold_comparisons_from_match_pd fix
authorRichard Biener <rguenther@suse.de>
Tue, 26 Jul 2022 09:52:49 +0000 (11:52 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 11 Nov 2022 14:04:53 +0000 (15:04 +0100)
commit4b3874d803e7961f38b22fa798517a63171bb985
tree6ff6be0480daf66bd4865141212a859ded2b1e93
parente0cfde7e8b36a8176b661af16dff91ebf4f99a8e
tree-optimization/105142 - improve maybe_fold_comparisons_from_match_pd fix

The following improves on the fix for PR105142 which restricted the
expression lookup used for maybe_fold_comparisons_from_match_pd to
avoid picking up flow-sensitive info for use in places where guarding
conditions do not hold.  Instead of not allowing to expand SSA
definitions there the following temporarily clears flow-sensitive
info on the SSA names and restores it when finished matching.

PR tree-optimization/105142
* gimple-fold.cc (fosa_unwind): New global.
(follow_outer_ssa_edges): When the SSA definition to follow
is does not dominate fosa_bb, temporarily clear flow-sensitive
info.  Make sure to not expand stmts with not defined overflow.
(maybe_fold_comparisons_from_match_pd): Set up unwind stack
for follow_outer_ssa_edges and unwind flow-sensitive info
clearing after matching.
gcc/gimple-fold.cc