aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-11-16 15:43:39 -0800
committerRichard Henderson <rth@gcc.gnu.org>2005-11-16 15:43:39 -0800
commit978dee9ad2cb226af83831bcd1becaa1652964e0 (patch)
treec288491f515c50ad8125312a40e42328d819a661 /gcc/tree-ssa.c
parentdbb28e4b135080a823bd74f922ff48e79b52946a (diff)
downloadgcc-978dee9ad2cb226af83831bcd1becaa1652964e0.zip
gcc-978dee9ad2cb226af83831bcd1becaa1652964e0.tar.gz
gcc-978dee9ad2cb226af83831bcd1becaa1652964e0.tar.bz2
re PR middle-end/23497 (Bogus 'is used uninitialized...' warning about std::complex<T>)
PR middle-end/23497 * tree-ssa.c (warn_uninitialized_var): Skip real and imaginary parts of an SSA_NAME. From-SVN: r107107
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 081d21a..7b24c59 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1155,14 +1155,29 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data)
{
tree t = *tp;
- /* We only do data flow with SSA_NAMEs, so that's all we can warn about. */
- if (TREE_CODE (t) == SSA_NAME)
+ switch (TREE_CODE (t))
{
+ case SSA_NAME:
+ /* We only do data flow with SSA_NAMEs, so that's all we
+ can warn about. */
warn_uninit (t, "%H%qD is used uninitialized in this function", data);
*walk_subtrees = 0;
+ break;
+
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ /* The total store transformation performed during gimplification
+ creates uninitialized variable uses. If all is well, these will
+ be optimized away, so don't warn now. */
+ if (TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME)
+ *walk_subtrees = 0;
+ break;
+
+ default:
+ if (IS_TYPE_OR_DECL_P (t))
+ *walk_subtrees = 0;
+ break;
}
- else if (IS_TYPE_OR_DECL_P (t))
- *walk_subtrees = 0;
return NULL_TREE;
}