PR tree-optimization/51039
* tree-cfg.c (verify_gimple_call): Verify that
gimple_call_cannot_inline_p is returning a conservative
correct result according to gimple_check_call_matching_types.
* ipa-inline-analysis.c (estimate_function_body_sizes): Remove
code dealing with un-inlinablility.
* gimple-streamer-in.c (input_gimple_stmt): Update the
non-inlinable flag.
* gcc.dg/pr51039.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181205
138bc75d-0d04-0410-961f-
82ee72b054a4
2011-11-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51039
2011-11-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51039
+ * tree-cfg.c (verify_gimple_call): Verify that
+ gimple_call_cannot_inline_p is returning a conservative
+ correct result according to gimple_check_call_matching_types.
+ * ipa-inline-analysis.c (estimate_function_body_sizes): Remove
+ code dealing with un-inlinablility.
+ * gimple-streamer-in.c (input_gimple_stmt): Update the
+ non-inlinable flag.
+
+2011-11-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/51039
* tree-inline.c (setup_one_parameter): Always perform a
valid gimple type change.
(declare_return_variable): Likewise.
* tree-inline.c (setup_one_parameter): Always perform a
valid gimple type change.
(declare_return_variable): Likewise.
}
if (is_gimple_call (stmt))
{
}
if (is_gimple_call (stmt))
{
if (gimple_call_internal_p (stmt))
gimple_call_set_internal_fn
(stmt, streamer_read_enum (ib, internal_fn, IFN_LAST));
else
gimple_call_set_fntype (stmt, stream_read_tree (ib, data_in));
if (gimple_call_internal_p (stmt))
gimple_call_set_internal_fn
(stmt, streamer_read_enum (ib, internal_fn, IFN_LAST));
else
gimple_call_set_fntype (stmt, stream_read_tree (ib, data_in));
+ /* Update the non-inlinable flag conservatively. */
+ fndecl = gimple_call_fndecl (stmt);
+ if (fndecl
+ && !gimple_call_cannot_inline_p (stmt)
+ && !gimple_check_call_matching_types (stmt, fndecl))
+ gimple_call_set_cannot_inline (stmt, true);
es->call_stmt_time = this_time;
es->loop_depth = bb->loop_depth;
edge_set_predicate (edge, &bb_predicate);
es->call_stmt_time = this_time;
es->loop_depth = bb->loop_depth;
edge_set_predicate (edge, &bb_predicate);
-
- /* Do not inline calls where we cannot triviall work around
- mismatches in argument or return types. */
- if (edge->callee
- && cgraph_function_or_thunk_node (edge->callee, NULL)
- && !gimple_check_call_matching_types
- (stmt, cgraph_function_or_thunk_node (edge->callee,
- NULL)->decl))
- {
- edge->call_stmt_cannot_inline_p = true;
- gimple_call_set_cannot_inline (stmt, true);
- }
- else
- gcc_assert (!gimple_call_cannot_inline_p (stmt));
}
/* TODO: When conditional jump or swithc is known to be constant, but
}
/* TODO: When conditional jump or swithc is known to be constant, but
+2011-11-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/51039
+ * gcc.dg/pr51039.c: New testcase.
+
2011-11-09 Jakub Jelinek <jakub@redhat.com>
* lib/target-supports.exp (check_effective_target_vect_cond_mixed):
2011-11-09 Jakub Jelinek <jakub@redhat.com>
* lib/target-supports.exp (check_effective_target_vect_cond_mixed):
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -finline-small-functions -fno-ipa-pure-const" } */
+
+float baz (void)
+{
+ return 0;
+}
+
+static inline int bar (int (*ibaz) (void))
+{
+ return ibaz ();
+}
+
+void foo (void)
+{
+ bar((int (*)(void))baz);
+}
+ /* Verify that if we have a direct call and the argument/return
+ types have mismatches the call is properly marked as noninlinable. */
+ if (fndecl
+ && !gimple_call_cannot_inline_p (stmt)
+ && !gimple_check_call_matching_types (stmt, fndecl))
+ {
+ error ("gimple call cannot be inlined but is not marked so");
+ return true;
+ }
+