https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126043
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=107740,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=126110
--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to ktkachov from comment #2)
> Allowing -(cast)CMP works well.
> Adding (cast)CMP unconditionally regresses some tree-ssa.exp tests:
> ssa-ifcombine-ccmp-6, fold-xor-and-or, fold-xor-or, if-to-switch-9, pr20701,
> pr21090, vrp33, vrp102, pr68198.
>
> We can avoid those though if we do this only when every use of the PHI
> result is an equality or inequality test against an integer constant
if-to-switch-9 is because if to switch should be improved to support this form.
That is exactly PR 107740 and I am running into it too when it comes to a
different patch.
pr20701 is a missed optimization in VRP; filed PR 126110. Looks like pr21090.c
is the same.
vrp33.c looks to be similar.
vrp102.c should change to look at evrp instead of vrp1 anyways.
pr68198.c seems to be doing the right thing in that we don't want the extra
jump threading here because it duplicates the bbs and never recombines them
(just like in your case). Just disable phiopt1 for the testcase.
fold-xor-and-or, fold-xor-or
Looks like a missing :c on the match patterns:
```
diff --git a/gcc/match.pd b/gcc/match.pd
index 7da15cc4cdc..51fd84b0208 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3823,14 +3823,14 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* ((a ^ b) & c) cmp d || a != b --> (0 cmp d || a != b). */
(for cmp (simple_comparison)
(simplify
- (bit_ior
+ (bit_ior:c
(cmp:c
(bit_and:c
- (bit_xor:c @0 @1)
+ (bit_xor @0 @1)
tree_expr_nonzero_p@2)
@3)
(ne@4 @0 @1))
- (bit_ior
+ (bit_ior:c
(cmp
{ build_zero_cst (TREE_TYPE (@0)); }
@3)
@@ -3839,12 +3839,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* (a ^ b) cmp c || a != b --> (0 cmp c || a != b). */
(for cmp (simple_comparison)
(simplify
- (bit_ior
+ (bit_ior:c
(cmp:c
- (bit_xor:c @0 @1)
+ (bit_xor @0 @1)
@2)
(ne@3 @0 @1))
- (bit_ior
+ (bit_ior:c
(cmp
{ build_zero_cst (TREE_TYPE (@0)); }
@2)
```
I am going to double check that but I think that is the cause for related
issues with that pattern on why they want to add something to reassociation.
That just leaves:
ssa-ifcombine-ccmp-6
Which might be iftoswitch issue or something else.