This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: silence warning in tree-ssa-pre.c
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Guenther <rguenther at suse dot de>
- Date: Wed, 03 Dec 2008 07:17:06 +1100
- Subject: PATCH: silence warning in tree-ssa-pre.c
My system compiler warns about an uninitialised variable used in
tree-ssa-pre.c. This patch initialises that variable and, for good
measure, asserts that it will have a non-null value before being
dereferenced. Okay for mainline, pending a successful bootstrap?
Cheers, Ben
2008-12-03 Ben Elliston <bje@au.ibm.com>
* tree-ssa-pre.c (do_regular_insertion): Initialise edoubleprime
and ensure it is never null before dereferencing.
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c (revision 142351)
+++ tree-ssa-pre.c (working copy)
@@ -3224,7 +3224,7 @@ do_regular_insertion (basic_block block,
basic_block bprime;
pre_expr eprime = NULL;
edge_iterator ei;
- pre_expr edoubleprime;
+ pre_expr edoubleprime = NULL;
val = get_expr_value_id (expr);
if (bitmap_set_contains_value (PHI_GEN (block), val))
@@ -3282,6 +3282,8 @@ do_regular_insertion (basic_block block,
all_same = false;
}
}
+ gcc_assert (edoubleprime != NULL);
+
/* If we can insert it, it's not the same value
already existing along every predecessor, and
it's defined by some predecessor, it is