make_pass_early_warn_uninitialized): Move from tree-ssa.c
* tree-ssa.h: Adjust prototypes
+2013-09-17 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/58332
+ * cif-code.def (FUNCTION_NOT_OPTIMIZED): New CIF code.
+ * ipa-inline.c (can_inline_edge_p): Do not downgrade
+ FUNCTION_NOT_OPTIMIZED.
+ * ipa-inline-analysis.c (compute_inline_parameters): Function
+ not optimized is not inlinable unless it is alwaysinline.
+ (inline_analyze_function): Force calls in not optimized
+ function not inlinable.
+
2013-09-17 Jan Hubicka <jh@suse.cz>
PR middle-end/58329
functions that have not been rejected for inlining yet. */
DEFCIFCODE(FUNCTION_NOT_CONSIDERED, N_("function not considered for inlining"))
+/* Caller is compiled with optimizations disabled. */
+DEFCIFCODE(FUNCTION_NOT_OPTIMIZED, N_("caller is not optimized"))
+
/* Inlining failed owing to unavailable function body. */
DEFCIFCODE(BODY_NOT_AVAILABLE, N_("function body not available"))
info->stack_frame_offset = 0;
/* Can this function be inlined at all? */
- info->inlinable = tree_inlinable_function_p (node->symbol.decl);
+ if (!optimize && !lookup_attribute ("always_inline",
+ DECL_ATTRIBUTES (node->symbol.decl)))
+ info->inlinable = false;
+ else
+ info->inlinable = tree_inlinable_function_p (node->symbol.decl);
/* Type attributes can use parameter indices to describe them. */
if (TYPE_ATTRIBUTES (TREE_TYPE (node->symbol.decl)))
if (optimize && !node->thunk.thunk_p)
inline_indirect_intraprocedural_analysis (node);
compute_inline_parameters (node, false);
+ if (!optimize)
+ {
+ struct cgraph_edge *e;
+ for (e = node->callees; e; e = e->next_callee)
+ {
+ if (e->inline_failed == CIF_FUNCTION_NOT_CONSIDERED)
+ e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED;
+ e->call_stmt_cannot_inline_p = true;
+ }
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ {
+ if (e->inline_failed == CIF_FUNCTION_NOT_CONSIDERED)
+ e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED;
+ e->call_stmt_cannot_inline_p = true;
+ }
+ }
pop_cfun ();
}
}
else if (e->call_stmt_cannot_inline_p)
{
- e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
+ if (e->inline_failed != CIF_FUNCTION_NOT_OPTIMIZED)
+ e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
inlinable = false;
}
/* Don't inline if the functions have different EH personalities. */
+2013-09-17 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/58332
+ * gcc.c-torture/compile/pr58332.c: New testcase.
+
2013-09-17 Jeff Law <law@redhat.com>
* gcc.c-torture/execute/pr58387.c: New test.
--- /dev/null
+static inline int foo (int x) { return x + 1; }
+__attribute__ ((__optimize__ (0))) int bar (void) { return foo (100); }