diff options
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 5a41818..4cd86c6 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1239,17 +1239,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type) && TYPE_RESTRICT (outer_type)) return false; - /* If the outer type is (void *) or a pointer to an incomplete - record type or a pointer to an unprototyped function, - then the conversion is not necessary. */ - if (VOID_TYPE_P (TREE_TYPE (outer_type)) - || ((TREE_CODE (TREE_TYPE (outer_type)) == FUNCTION_TYPE - || TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE) - && (TREE_CODE (TREE_TYPE (outer_type)) - == TREE_CODE (TREE_TYPE (inner_type))) - && !prototype_p (TREE_TYPE (outer_type)) - && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (outer_type)), - TREE_TYPE (TREE_TYPE (inner_type))))) + /* If the outer type is (void *), the conversion is not necessary. */ + if (VOID_TYPE_P (TREE_TYPE (outer_type))) return true; } @@ -1305,8 +1296,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type) /* Do not lose casts to function pointer types. */ if ((TREE_CODE (TREE_TYPE (outer_type)) == FUNCTION_TYPE || TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE) - && !useless_type_conversion_p (TREE_TYPE (outer_type), - TREE_TYPE (inner_type))) + && !(TREE_CODE (TREE_TYPE (inner_type)) == FUNCTION_TYPE + || TREE_CODE (TREE_TYPE (inner_type)) == METHOD_TYPE)) return false; /* We do not care for const qualification of the pointed-to types |