diff options
author | Richard Biener <rguenther@suse.de> | 2020-10-19 10:41:19 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-10-19 10:44:11 +0200 |
commit | dccb0f8801363462a11fd13a33ff3f4092ff82bd (patch) | |
tree | 90800858766681f3ea63cf73c643b73ad82997ef /gcc/tree-cfg.c | |
parent | 04ffed2ef298bcdec5fe10da23dac1e95131516a (diff) | |
download | gcc-dccb0f8801363462a11fd13a33ff3f4092ff82bd.zip gcc-dccb0f8801363462a11fd13a33ff3f4092ff82bd.tar.gz gcc-dccb0f8801363462a11fd13a33ff3f4092ff82bd.tar.bz2 |
Simplify comparison GIMPLE IL verification
There's an old extra allowance for same-mode pointer comparison
for which I don't see any good reason today where the only special-case
of pointers in useless_type_conversion_p is that of function/method
pointers vs. non-function/method pointers.
2020-10-19 Richard Biener <rguenther@suse.de>
* tree-cfg.c (verify_gimple_comparison): Drop special-case
for pointer comparison.
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 002560d..3d825c2 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3489,14 +3489,9 @@ verify_gimple_comparison (tree type, tree op0, tree op1, enum tree_code code) /* For comparisons we do not have the operations type as the effective type the comparison is carried out in. Instead we require that either the first operand is trivially - convertible into the second, or the other way around. - Because we special-case pointers to void we allow - comparisons of pointers with the same mode as well. */ + convertible into the second, or the other way around. */ if (!useless_type_conversion_p (op0_type, op1_type) - && !useless_type_conversion_p (op1_type, op0_type) - && (!POINTER_TYPE_P (op0_type) - || !POINTER_TYPE_P (op1_type) - || TYPE_MODE (op0_type) != TYPE_MODE (op1_type))) + && !useless_type_conversion_p (op1_type, op0_type)) { error ("mismatching comparison operand types"); debug_generic_expr (op0_type); |