This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: silence warning in tree-ssa-pre.c
- From: Richard Guenther <rguenther at suse dot de>
- To: Ben Elliston <bje at au1 dot ibm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 2 Dec 2008 21:20:04 +0100 (CET)
- Subject: Re: PATCH: silence warning in tree-ssa-pre.c
- References: <1228249026.3110.6.camel@helios>
On Wed, 3 Dec 2008, Ben Elliston wrote:
> 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?
Ok.
Thanks,
Richard.
> 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
>
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex