===================================================================
@@ -7,7 +7,7 @@ foo () /* { dg-error "inlining failed in
return 0;
}
int bar()
{
- return foo (); /* { dg-error "called from here" } */
+ return foo (); /* { dg-message "called from here" } */
}
===================================================================
@@ -9,11 +9,11 @@ __inline int callee () /* { dg-error "in
}
__attribute__((target("sse")))
static __inline int caller ()
{
- return callee(); /* { dg-error "called from here" } */
+ return callee(); /* { dg-message "called from here" } */
}
int main ()
{
return caller();
===================================================================
@@ -16,7 +16,7 @@ _mm_set_epi32 (int __q3, int __q2, int _
__m128i
f1(void)
{ /* { dg-message "warning: SSE vector return without SSE enabled changes the ABI" } */
- return _mm_set_epi32 (0, 0, 0, 0); /* { dg-error "called from here" } */
+ return _mm_set_epi32 (0, 0, 0, 0); /* { dg-message "called from here" } */
}
===================================================================
@@ -8,9 +8,9 @@
#include <smmintrin.h>
__m128i foo(__m128i *V)
{
- return _mm_stream_load_si128(V); /* { dg-error "called from here" } */
+ return _mm_stream_load_si128(V); /* { dg-message "called from here" } */
}
/* { dg-prune-output ".*inlining failed.*" } */
===================================================================
@@ -8,9 +8,9 @@
#include <smmintrin.h>
__m128i foo(__m128i *V)
{
- return _mm_stream_load_si128(V); /* { dg-error "called from here" } */
+ return _mm_stream_load_si128(V); /* { dg-message "called from here" } */
}
/* { dg-prune-output ".*inlining failed.*" } */
===================================================================
@@ -15,7 +15,7 @@ inline int q(void) /* { dg-warning "inli
big();
big();
}
int t (void)
{
- return q (); /* { dg-warning "called from here" } */
+ return q (); /* { dg-message "called from here" } */
}
===================================================================
@@ -20,7 +20,7 @@ int
t()
{
if (a)
aa();
if (b)
- bb(); /* { dg-warning "called from here" "" } */
+ bb(); /* { dg-message "called from here" } */
}
===================================================================
@@ -2,7 +2,7 @@
/* { dg-options "-O2 -fgnu89-inline" } */
inline __attribute__ ((always_inline)) void t(void); /* { dg-error "body not available" } */
void
q(void)
{
- t(); /* { dg-error "called from here" } */
+ t(); /* { dg-message "called from here" } */
}
===================================================================
@@ -2,7 +2,7 @@
/* { dg-options "-Winline -O2 -fgnu89-inline" } */
inline int q(void); /* { dg-warning "body not available" "" } */
inline int t(void)
{
- return q(); /* { dg-warning "called from here" "" } */
+ return q(); /* { dg-message "called from here" } */
}
===================================================================
@@ -15,7 +15,7 @@ inline int q(void) /* { dg-warning "larg
big();
big();
}
inline int t (void)
{
- return q () + 1; /* { dg-warning "called from here" } */
+ return q () + 1; /* { dg-message "called from here" } */
}
===================================================================
@@ -9,9 +9,9 @@ inline void f (x) /* { dg-warning "inlin
asm ("");
}
void g (struct s x)
{
- f (x); /* { dg-warning "called from here" "" } */
+ f (x); /* { dg-message "called from here" } */
}
void f (int x); /* { dg-warning "follows non-prototype definition" } */
===================================================================
@@ -18,8 +18,8 @@ static inline int wrapper(const char **s
}
void parse(const char *data)
{
const char *s = data;
- if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-warning "called from here" } */
+ if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-message "called from here" } */
__builtin_abort();
}
===================================================================
@@ -4,8 +4,8 @@ int do_something_evil (void);
inline __attribute__ ((always_inline)) void
q2(void) /* { dg-error "recursive inlining" } */
{
if (do_something_evil ())
return;
- q2(); /* { dg-error "called from here" } */
+ q2(); /* { dg-message "called from here" } */
q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion. */
}
===================================================================
@@ -15,7 +15,7 @@ inline int q(void) /* { dg-warning "max-
big();
big();
}
inline int t (void)
{
- return q (); /* { dg-warning "called from here" "" } */
+ return q (); /* { dg-message "called from here" } */
}
===================================================================
@@ -9,7 +9,7 @@ inline void *q (void) /* { dg-warning "(
{
return alloca (10);
}
inline void *t (void)
{
- return q (); /* { dg-warning "called from here" } */
+ return q (); /* { dg-message "called from here" } */
}
===================================================================
@@ -4382,27 +4382,20 @@ expand_call_inline (basic_block bb, gimp
hash_map<tree, tree> *dst;
hash_map<tree, tree> *st = NULL;
tree return_slot;
tree modify_dest;
tree return_bounds = NULL;
- location_t saved_location;
struct cgraph_edge *cg_edge;
cgraph_inline_failed_t reason;
basic_block return_block;
edge e;
gimple_stmt_iterator gsi, stmt_gsi;
- bool successfully_inlined = FALSE;
+ bool successfully_inlined = false;
bool purge_dead_abnormal_edges;
gcall *call_stmt;
unsigned int i;
- /* Set input_location here so we get the right instantiation context
- if we call instantiate_decl from inlinable_function_p. */
- /* FIXME: instantiate_decl isn't called by inlinable_function_p. */
- saved_location = input_location;
- input_location = gimple_location (stmt);
-
/* From here on, we're only interested in CALL_EXPRs. */
call_stmt = dyn_cast <gcall *> (stmt);
if (!call_stmt)
goto egress;
@@ -4452,11 +4445,15 @@ expand_call_inline (basic_block bb, gimp
/* PR 20090218-1_0.c. Body can be provided by another module. */
&& (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto))
{
error ("inlining failed in call to always_inline %q+F: %s", fn,
cgraph_inline_failed_string (reason));
- error ("called from here");
+ if (gimple_location (stmt) != UNKNOWN_LOCATION)
+ inform (gimple_location (stmt), "called from here");
+ else if (DECL_SOURCE_LOCATION (cfun->decl) != UNKNOWN_LOCATION)
+ inform (DECL_SOURCE_LOCATION (cfun->decl),
+ "called from this function");
}
else if (warn_inline
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_NO_INLINE_WARNING_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn)
@@ -4465,13 +4461,19 @@ expand_call_inline (basic_block bb, gimp
/* Do not warn about not inlined recursive calls. */
&& !cg_edge->recursive_p ()
/* Avoid warnings during early inline pass. */
&& symtab->global_info_ready)
{
- warning (OPT_Winline, "inlining failed in call to %q+F: %s",
- fn, _(cgraph_inline_failed_string (reason)));
- warning (OPT_Winline, "called from here");
+ if (warning (OPT_Winline, "inlining failed in call to %q+F: %s",
+ fn, _(cgraph_inline_failed_string (reason))))
+ {
+ if (gimple_location (stmt) != UNKNOWN_LOCATION)
+ inform (gimple_location (stmt), "called from here");
+ else if (DECL_SOURCE_LOCATION (cfun->decl) != UNKNOWN_LOCATION)
+ inform (DECL_SOURCE_LOCATION (cfun->decl),
+ "called from this function");
+ }
}
goto egress;
}
fn = cg_edge->callee->decl;
cg_edge->callee->get_untransformed_body ();
@@ -4532,11 +4533,12 @@ expand_call_inline (basic_block bb, gimp
not refer to them in any way to not break GC for locations. */
if (gimple_block (stmt))
{
id->block = make_node (BLOCK);
BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
- BLOCK_SOURCE_LOCATION (id->block) = LOCATION_LOCUS (input_location);
+ BLOCK_SOURCE_LOCATION (id->block)
+ = LOCATION_LOCUS (gimple_location (stmt));
prepend_lexical_block (gimple_block (stmt), id->block);
}
/* Local declarations will be replaced by their equivalents in this
map. */
@@ -4797,14 +4798,13 @@ expand_call_inline (basic_block bb, gimp
/* Update callgraph if needed. */
cg_edge->callee->remove ();
id->block = NULL_TREE;
- successfully_inlined = TRUE;
+ successfully_inlined = true;
egress:
- input_location = saved_location;
return successfully_inlined;
}
/* Expand call statements reachable from STMT_P.
We can only have CALL_EXPRs as the "toplevel" tree code or nested