This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: silence warning in tree-ssa-pre.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]