]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix is_gimple_condexpr vs is_gimple_condexpr_for_cond
authorRichard Biener <rguenther@suse.de>
Mon, 11 Apr 2022 10:18:48 +0000 (12:18 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 29 Apr 2022 10:13:48 +0000 (12:13 +0200)
commitc090743b2ae0095f792371c7cbeb3cf6e2978f5d
tree3526e923d4e83fd10ccb3f13dc23214b24203c86
parent4aa61e08ade43fa1e94dc0e951f11739bbd2ae40
Fix is_gimple_condexpr vs is_gimple_condexpr_for_cond

The following fixes wrongly used is_gimple_condexpr and makes
canonicalize_cond_expr_cond honor either, delaying final checking
to callers where all but two in ifcombine are doing the correct
thing already.

This fixes bugs but is now mainly in preparation for making
COND_EXPRs in GIMPLE assignments no longer have a GENERIC expression
as condition operand like we already transitioned VEC_COND_EXPR earlier.

2022-04-11  Richard Biener  <rguenther@suse.de>

* gimple-expr.cc (is_gimple_condexpr): Adjust comment.
(canonicalize_cond_expr_cond): Move here from gimple.cc,
allow both COND_EXPR and GIMPLE_COND forms.
* gimple-expr.h (canonicalize_cond_expr_cond): Declare.
* gimple.cc (canonicalize_cond_expr_cond): Remove here.
* gimple.h (canonicalize_cond_expr_cond): Likewise.
* gimple-loop-versioning.cc (loop_versioning::version_loop):
Use is_gimple_condexpr_for_cond.
* tree-parloops.cc (gen_parallel_loop): Likewise.
* tree-ssa-ifcombine.cc (ifcombine_ifandif): Check for
a proper cond expr after canonicalize_cond_expr_cond.
Use is_gimple_condexpr_for_cond where appropriate.
* tree-ssa-loop-manip.cc (determine_exit_conditions): Likewise.
* tree-vect-loop-manip.cc (slpeel_add_loop_guard): Likewise.
gcc/gimple-expr.cc
gcc/gimple-expr.h
gcc/gimple-loop-versioning.cc
gcc/gimple.cc
gcc/gimple.h
gcc/tree-parloops.cc
gcc/tree-ssa-ifcombine.cc
gcc/tree-ssa-loop-manip.cc
gcc/tree-vect-loop-manip.cc