diff options
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 1446612..f922e82 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1154,7 +1154,7 @@ warn_uninit (tree t, const char *gmsgid, void *data) tree var = SSA_NAME_VAR (t); tree def = SSA_NAME_DEF_STMT (t); tree context = (tree) data; - location_t * locus; + location_t *locus, *fun_locus; /* Default uses (indicated by an empty definition statement), are uninitialized. */ @@ -1178,6 +1178,12 @@ warn_uninit (tree t, const char *gmsgid, void *data) ? EXPR_LOCUS (context) : &DECL_SOURCE_LOCATION (var)); warning (0, gmsgid, locus, var); + fun_locus = &DECL_SOURCE_LOCATION (cfun->decl); + if (locus->file != fun_locus->file + || locus->line < fun_locus->line + || locus->line > cfun->function_end_locus.line) + inform ("%J%qD was declared here", var, var); + TREE_NO_WARNING (var) = 1; } |