This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/43347] Warning about symbols generated by SRA being used uninitialized
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2010 14:12:54 -0000
- Subject: [Bug tree-optimization/43347] Warning about symbols generated by SRA being used uninitialized
- References: <bug-43347-5606@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-03-12 14:12 -------
I suppose %qD expansion in diagnostics should check DECL_DEBUG_EXPR_IS_FROM
and instead should show DECL_DEBUG_EXPR.
Sth like
Index: trunk/gcc/tree-ssa.c
===================================================================
--- trunk.orig/gcc/tree-ssa.c 2010-03-12 15:12:15.000000000 +0100
+++ trunk/gcc/tree-ssa.c 2010-03-12 15:10:52.000000000 +0100
@@ -1643,6 +1643,10 @@ warn_uninit (tree t, const char *gmsgid,
if (!ssa_undefined_value_p (t))
return;
+ if (TREE_CODE (var) == VAR_DECL
+ && DECL_DEBUG_EXPR_IS_FROM (var))
+ var = DECL_DEBUG_EXPR (var);
+
/* TREE_NO_WARNING either means we already warned, or the front end
wishes to suppress the warning. */
if (TREE_NO_WARNING (var))
might fix it local in uninitialized warnings
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43347