[PATCH] Fix PR39246: -Wuninitialized for partially initialized complex
Thomas Preud'homme
thomas.preudhomme@arm.com
Tue May 6 09:52:00 GMT 2014
Hi Richard,
> From: Richard Biener [mailto:richard.guenther@gmail.com]
> >
> > The ChangeLog are as follows:
> >
> > *** gcc/ChangeLog ***
> >
> > 2014-05-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
> >
> > PR middle-end/39246
> > * tree-complex.c (expand_complex_move): Keep line info when
> expanding
> > complex move.
>
> This part and the corresponding testcase adjustment is ok. You can
> commit it separately.
Only the change to tree-complex.c should be commited then, as it just changes
the location for target where the test was failing to the return line.
The current situation for uninit-13.c is:
Warning location
Target return complex in register(s) partial init
Target return complex on the stack declaration
With the change to tree-complex.c the situation for the same test becomes:
Warning location
Target return complex in register(s) partial init
Target return complex on the stack return
So either I don't touch the test or I move it to the return but I will just change
the set of target for which this test fails in doing so.
>
> > * tree-ssa-uninit.c (warn_uninit): New argument. Ignore assignment of
> > complex expression. Use new argument to display correct location for
> > values coming from phi statement.
> > (warn_uninitialized_vars): Adapt to new signature of warn_uninit.
> > (warn_uninitialized_phi): Pass location of phi argument to warn_uninit.
> > * tree-ssa.c (ssa_undefined_value_p): For SSA_NAME initialized by a
> > COMPLEX_EXPR, recurse on each part of the COMPLEX_EXPR.
>
> This change will also affect PRE in a bogus way. It also affects
> tree-complex.c lowering process, eventually in a similar pessimizing way.
>
> So please do the change local to tree-ssa-uninit.c.
Done, see attached patch.
Best regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc32rm-91.2.0.diff
Type: application/octet-stream
Size: 7352 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140506/ad1db70b/attachment.obj>
More information about the Gcc-patches
mailing list