This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR64764
- From: Richard Biener <rguenther at suse dot de>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Feb 2015 09:59:50 +0100 (CET)
- Subject: Re: [PATCH] Fix PR64764
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1501261547050 dot 12482 at zhemvz dot fhfr dot qr> <54D357C4 dot 1060401 at mentor dot com>
On Thu, 5 Feb 2015, Tom de Vries wrote:
> On 26-01-15 15:47, Richard Biener wrote:
> > Index: gcc/testsuite/gcc.dg/uninit-19.c
> > ===================================================================
> > --- gcc/testsuite/gcc.dg/uninit-19.c (revision 0)
> > +++ gcc/testsuite/gcc.dg/uninit-19.c (working copy)
> > @@ -0,0 +1,23 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O -Wuninitialized" } */
> > +
> > +int a, l, m;
> > +float *b;
> > +float c, d, e, g, h;
> > +unsigned char i, k;
> > +void
> > +fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
> > + unsigned char *c2, float *p10)
> > +{
> > + if (p1 & 8)
> > + b[3] = p10[a]; /* { dg-warning "may be used uninitialized" } */
> > +}
> > +
> > +void
> > +fn2 ()
> > +{
> > + float *n;
> > + if (l & 6)
> > + n = &c + m;
> > + fn1 (l, &d, &e, &g, &i, &h, &k, n);
> > +}
>
> Hi Richard,
>
> this new test fails with -fpic, because fn1 is not inlined.
>
> Adding static to fn1 allows it to pass both with and without -fpic. But that
> change might affect whether it still serves as a regression test for this PR,
> I'm not sure.
>
> Another way to fix this could be to use the warning line number 22 instead 13
> for fpic.
Either way is fine with me.
Thanks,
Richard.