+2005-11-16 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/23497
+ * tree-ssa.c (warn_uninitialized_var): Skip real and imaginary
+ parts of an SSA_NAME.
+
2005-11-16 Richard Earnshaw <richard.earnshaw@arm.com>
PR target/24861
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+typedef _Complex float C;
+C foo()
+{
+ C f;
+ __imag__ f = 0;
+ return f; /* { dg-warning "" "uninit" { xfail *-*-* } } */
+}
{
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;
}