diff options
author | Ben Elliston <bje@au.ibm.com> | 2006-11-03 00:56:35 +0000 |
---|---|---|
committer | Ben Elliston <bje@gcc.gnu.org> | 2006-11-03 11:56:35 +1100 |
commit | 50f606a629ca09f8cbf9c595362ad3e23c79cb5d (patch) | |
tree | 7394653e361edf95d8a4d36f93702c6763ec4ca7 /gcc/tree-ssa.c | |
parent | bf821e6ad510185ae959fd7787bd068b2aa0bd3f (diff) | |
download | gcc-50f606a629ca09f8cbf9c595362ad3e23c79cb5d.zip gcc-50f606a629ca09f8cbf9c595362ad3e23c79cb5d.tar.gz gcc-50f606a629ca09f8cbf9c595362ad3e23c79cb5d.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index f922e82..b90916f 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1154,7 +1154,8 @@ 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, *fun_locus; + location_t *locus; + expanded_location xloc, floc; /* Default uses (indicated by an empty definition statement), are uninitialized. */ @@ -1178,10 +1179,11 @@ 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) + xloc = expand_location (*locus); + floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl)); + if (xloc.file != floc.file + || xloc.line < floc.line + || xloc.line > LOCATION_LINE (cfun->function_end_locus)) inform ("%J%qD was declared here", var, var); TREE_NO_WARNING (var) = 1; |