aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-04-12 10:44:15 +0000
committerRichard Guenther <rguenther@suse.de>2011-04-12 10:44:15 +0000
commit0f4b002b5f6e9dc25a4e9d3c2e58bc6f55692624 (patch)
treee792618dd649e3a0226cbeeef5d614d64ccfe552 /gcc/tree-ssa.c
parent7abf22fe40752289f015d045e71d5158958eefe3 (diff)
2011-04-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46076 * gimple.h (struct gimple_statement_call): Add fntype field. (gimple_call_fntype): Adjust. (gimple_call_set_fntype): New function. * gimple.c (gimple_build_call_1): Set the call function type. * gimplify.c (gimplify_call_expr): Preserve the function type the frontend used for the call. (gimplify_modify_expr): Likewise. * lto-streamer-in.c (input_gimple_stmt): Input the call stmts function type. * lto-streamer-out.c (output_gimple_stmt): Output the call stmts function type. * tree-ssa.c (useless_type_conversion_p): Function pointer conversions are useless. * gcc.dg/tree-ssa/pr46076.c: Un-XFAIL. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@172310 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 5a41818c575..4cd86c6781f 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