summaryrefslogtreecommitdiffstats
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-29 15:52:54 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-29 15:52:54 +0000
commit4f652d47e74bba4e82d0e165b502beb38861eedc (patch)
tree7c990387a481812ec429ef6fcf7b9d2e03aebf82 /gcc/tree-ssa.c
parentcf8e3323a685cb38c02438d5c6de2bb2e54457df (diff)
downloadppe42-gcc-4f652d47e74bba4e82d0e165b502beb38861eedc.tar.gz
ppe42-gcc-4f652d47e74bba4e82d0e165b502beb38861eedc.zip
gcc:
2006-08-29 Nathan Sidwell <nathan@codesourcery.com> J"orn Rennecke <joern.rennecke@st.com> PR tree-optimization/17506 * tree-ssa.c (warn_uninit): If warning about a location outside of the current function, note where the variable was declared. testsuite: 2006-08-29 Volker Reichelt <reichelt@igpm.rwth-aachen.de> Kazu Hirata <kazu@codesourcery.com> PR tree-optimization/17506 * gcc.dg/pr17506.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116564 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 14466124318..f922e825444 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;
}
OpenPOWER on IntegriCloud