]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa.c (warn_uninit): Use expand_location variables for locus and declaration...
authorBen Elliston <bje@au.ibm.com>
Fri, 3 Nov 2006 00:56:35 +0000 (00:56 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Fri, 3 Nov 2006 00:56:35 +0000 (11:56 +1100)
* tree-ssa.c (warn_uninit): Use expand_location variables for
locus and declaration locus.

From-SVN: r118444

gcc/ChangeLog
gcc/tree-ssa.c

index 383ce954b568d4bba473964c145ee0e95c105c47..189604c5c398690ab5969d7772dd7cb59e9b28b4 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        PR target/27405
index f922e8254445db516f273e761c644713f1975b66..b90916f877d73bd85ffb27cddba3615615724eeb 100644 (file)
@@ -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;