Commit dc0bfe6a by Jan Hubicka Committed by Jan Hubicka

Makefile.in (cgraph.o, [...]): Add intl.h dependency.


	* Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency.
	* cgraph.c (create_edge, dump_cgraph): Update to use inline_failed
	* cgraph.h (cgraph_edge): Replace inline_call by inline_failed
	(cgraph_inline_p): Add extra argument reason.
	* cgraphunit.c: Minor formating fixes.
	cgraph_first_inlined_callee): New functions.
	(record_call_1): Record builtins too.
	(cgraph_analyze_function): Update inline_failed messages.
	(cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into,
	cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed.
	(cgraph_check_inline_limits): Likewise; Add argument reason.
	(cgraph_set_inline_failed): New static function.
	(cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set
	reasons.
	(cgraph_inline_p): Add new argument reason.
	* tree-inline.c (expand_call_inline):  Update warning.

From-SVN: r75391
parent e42870df
2004-01-04 Jan Hubicka <jh@suse.cz>
* Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency.
* cgraph.c (create_edge, dump_cgraph): Update to use inline_failed
* cgraph.h (cgraph_edge): Replace inline_call by inline_failed
(cgraph_inline_p): Add extra argument reason.
* cgraphunit.c: Minor formating fixes.
cgraph_first_inlined_callee): New functions.
(record_call_1): Record builtins too.
(cgraph_analyze_function): Update inline_failed messages.
(cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into,
cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed.
(cgraph_check_inline_limits): Likewise; Add argument reason.
(cgraph_set_inline_failed): New static function.
(cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set
reasons.
(cgraph_inline_p): Add new argument reason.
* tree-inline.c (expand_call_inline): Update warning.
2004-01-03 Nathanael Nerode <neroden@gcc.gnu.org>
* configure.ac: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM
......
......@@ -1633,9 +1633,10 @@ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RT
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h gt-cgraph.h output.h
langhooks.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h gt-cgraph.h \
output.h intl.h
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h tree-inline.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h
langhooks.h tree-inline.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h intl.h
coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \
toplev.h $(GGC_H) $(TARGET_H) langhooks.h $(COVERAGE_H) libfuncs.h \
......
......@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cgraph.h"
#include "varray.h"
#include "output.h"
#include "intl.h"
/* Hash table used to convert declarations into nodes. */
......@@ -156,7 +157,13 @@ create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
struct cgraph_edge *edge2;
edge->inline_call = false;
if (!DECL_SAVED_TREE (callee->decl))
edge->inline_failed = N_("function body not available");
else if (callee->local.inlinable)
edge->inline_failed = N_("function not considered for inlining");
else
edge->inline_failed = N_("function not inlinable");
/* At the moment we don't associate calls with specific CALL_EXPRs
as we probably ought to, so we must preserve inline_call flags to
be the same in all copies of the same edge. */
......@@ -164,7 +171,7 @@ create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
for (edge2 = caller->callees; edge2; edge2 = edge2->next_callee)
if (edge2->callee == callee)
{
edge->inline_call = edge2->inline_call;
edge->inline_failed = edge2->inline_failed;
break;
}
......@@ -381,7 +388,7 @@ dump_cgraph (FILE *f)
for (edge = node->callers; edge; edge = edge->next_caller)
{
fprintf (f, "%s ", cgraph_node_name (edge->caller));
if (edge->inline_call)
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
}
......@@ -389,7 +396,7 @@ dump_cgraph (FILE *f)
for (edge = node->callees; edge; edge = edge->next_callee)
{
fprintf (f, "%s ", cgraph_node_name (edge->callee));
if (edge->inline_call)
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
}
fprintf (f, "\n");
......
......@@ -119,7 +119,9 @@ struct cgraph_edge GTY(())
struct cgraph_node *callee;
struct cgraph_edge *next_caller;
struct cgraph_edge *next_callee;
bool inline_call;
/* When NULL, inline this call. When non-NULL, points to the explanation
why function was not inlined. */
const char *inline_failed;
};
/* The cgraph_varpool data structure.
......@@ -181,6 +183,6 @@ void cgraph_create_edges (tree, tree);
void cgraph_optimize (void);
void cgraph_mark_needed_node (struct cgraph_node *);
void cgraph_mark_reachable_node (struct cgraph_node *);
bool cgraph_inline_p (tree, tree);
bool cgraph_inline_p (tree, tree, const char **reason);
#endif /* GCC_CGRAPH_H */
2004-01-04 Jan Hubicka <jh@suse.cz>
* gcc.dg/winline[1-7].c: New tests.
2004-01-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/13520
......
/* { dg-do compile } */
/* { dg-options "-Winline -O2" } */
void q(void);
inline int t(void)
{
int ret;
q();
ret = t(); /* We define sane semantics for inline keyword on recursive
functions, so do not warn here. */
q();
return ret;
}
/* { dg-do compile } */
/* { dg-options "-Winline -O2" } */
inline int q(void); /* { dg-warning "body not available" "" } */
inline int t(void)
{
return q(); /* { dg-warning "called from here" "" } */
}
/* { dg-do compile } */
/* { dg-options "-Winline -O2 --param max-inline-insns-single=1" } */
void big (void);
inline int q(void)
{ /* { dg-warning "max-inline-insns-single" "" } */
big();
big();
big();
big();
big();
big();
big();
big();
big();
big();
}
inline int t (void)
{
return q (); /* { dg-warning "called from here" "" } */
}
/* { dg-do compile } */
/* { dg-options "-Winline -O1 -fno-unit-at-a-time" } */
inline int q(void); /* { dg-warning "body not available" } */
inline int t(void)
{
return q(); /* { dg-warning "called from here" } */
}
int q(void)
{
}
/* { dg-do compile } */
/* { dg-options "-Winline -O2 --param inline-unit-growth=0" } */
void big (void);
inline int q(void)
{ /* { dg-warning "inline-unit-growth" } */
big();
big();
big();
big();
big();
big();
big();
big();
big();
big();
}
inline int q1(void)
{
big();
big();
big();
}
int t (void)
{
/* We allow one inlining over limit. */
q1();
return q (); /* { dg-warning "called from here" } */
}
/* { dg-do compile } */
/* { dg-options "-Winline -O2 --param large-function-growth=0 --param large-function-insns=1" } */
void big (void);
inline int q(void)
{ /* { dg-warning "large-function-growth" } */
big();
big();
big();
big();
big();
big();
big();
big();
big();
big();
}
inline int t (void)
{
return q (); /* { dg-warning "called from here" } */
}
/* { dg-do compile } */
/* { dg-options "-Winline -O2" } */
void big (void);
inline int q(void)
{ /* { dg-warning "(function not inlinable|alloca)" } */
return (int)alloca(10);
}
inline int t (void)
{
return q (); /* { dg-warning "called from here" } */
}
......@@ -1247,6 +1247,7 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
splay_tree st;
tree args;
tree return_slot_addr;
const char *reason;
/* See what we've got. */
id = (inline_data *) data;
......@@ -1327,12 +1328,13 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
/* Don't try to inline functions that are not well-suited to
inlining. */
if (!DECL_SAVED_TREE (fn) || !cgraph_inline_p (id->current_decl, fn))
if (!cgraph_inline_p (id->current_decl, fn, &reason))
{
if (warn_inline && DECL_INLINE (fn) && DECL_DECLARED_INLINE_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn))
if (warn_inline && DECL_DECLARED_INLINE_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn)
&& strlen (reason))
{
warning ("%Jinlining failed in call to '%F'", fn, fn);
warning ("%Jinlining failed in call to '%F': %s", fn, fn, reason);
warning ("called from here");
}
return NULL_TREE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment