Commit 50f606a6 by Ben Elliston Committed by Ben Elliston

tree-ssa.c (warn_uninit): Use expand_location variables for locus and declaration locus.

	* tree-ssa.c (warn_uninit): Use expand_location variables for
	locus and declaration locus.

From-SVN: r118444
parent bf821e6a
2006-11-02 Ben Elliston <bje@au.ibm.com>
* tree-ssa.c (warn_uninit): Use expand_location variables for
locus and declaration locus.
2006-11-02 Kaz Kojima <kkojima@gcc.gnu.org> 2006-11-02 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/27405 PR target/27405
......
...@@ -1154,7 +1154,8 @@ warn_uninit (tree t, const char *gmsgid, void *data) ...@@ -1154,7 +1154,8 @@ warn_uninit (tree t, const char *gmsgid, void *data)
tree var = SSA_NAME_VAR (t); tree var = SSA_NAME_VAR (t);
tree def = SSA_NAME_DEF_STMT (t); tree def = SSA_NAME_DEF_STMT (t);
tree context = (tree) data; tree context = (tree) data;
location_t *locus, *fun_locus; location_t *locus;
expanded_location xloc, floc;
/* Default uses (indicated by an empty definition statement), /* Default uses (indicated by an empty definition statement),
are uninitialized. */ are uninitialized. */
...@@ -1178,10 +1179,11 @@ warn_uninit (tree t, const char *gmsgid, void *data) ...@@ -1178,10 +1179,11 @@ warn_uninit (tree t, const char *gmsgid, void *data)
? EXPR_LOCUS (context) ? EXPR_LOCUS (context)
: &DECL_SOURCE_LOCATION (var)); : &DECL_SOURCE_LOCATION (var));
warning (0, gmsgid, locus, var); warning (0, gmsgid, locus, var);
fun_locus = &DECL_SOURCE_LOCATION (cfun->decl); xloc = expand_location (*locus);
if (locus->file != fun_locus->file floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
|| locus->line < fun_locus->line if (xloc.file != floc.file
|| locus->line > cfun->function_end_locus.line) || xloc.line < floc.line
|| xloc.line > LOCATION_LINE (cfun->function_end_locus))
inform ("%J%qD was declared here", var, var); inform ("%J%qD was declared here", var, var);
TREE_NO_WARNING (var) = 1; TREE_NO_WARNING (var) = 1;
......
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