aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
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 081d21a7b97..7b24c594a5c 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;
}