This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] new -Wuninitialized warning
- From: Jason Merrill <jason at redhat dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc at gcc dot gnu dot org, Jason Merrill <jason at redhat dot com>
- Date: Sat, 07 Jun 2003 12:40:43 -0400
- Subject: [tree-ssa] new -Wuninitialized warning
After I apply this patch to cp/pt.c, bootstrap fails with a warning about
expr_type possibly being used uninitialized. This turns out to be because
DCE is discarding the initial initialization of expr_type. This isn't
actually a bug, since ssa->normal seems to be properly inserting
initializations along all paths to uses, but it seems that the RTL flow
graph isn't clever enough to realize that.
I ran into this by way of a patch I've been working on to evaluate
expressions into formal temps before assigning them to user vars, so as to
expose more expressions to redundancy elimination.
Thoughts?
Jason
*** gcc/cp/pt.c.~1~ 2003-06-03 15:56:15.000000000 -0400
--- gcc/cp/pt.c 2003-06-07 12:25:49.000000000 -0400
*************** convert_nontype_argument (type, expr)
*** 3077,3083 ****
tree type;
tree expr;
{
! tree expr_type = TREE_TYPE (expr);
/* A template-argument for a non-type, non-template
template-parameter shall be one of:
--- 3077,3084 ----
tree type;
tree expr;
{
! tree foo = TREE_TYPE (expr);
! tree expr_type = foo;
/* A template-argument for a non-type, non-template
template-parameter shall be one of: