This is the mail archive of the mailing list for the glibc 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: [PATCHv3] sysdeps/ieee754: prevent maybe-uninitialized errors with -O [BZ #19444]

On Sun, Sep 30, 2018 at 04:52:56PM +0000, Joseph Myers wrote:
> On Sun, 30 Sep 2018, Martin Jansa wrote:
> > +	    /* With GCC 8 (and older) when compiling with -O the compiler
> > +	       warns that the variable 'temp', may be used uninitialized.
> > +	       The switch above covers all possible values of n & 3
> > +	       but GCC without VRP enabled isn't able to figure out the
> > +	       range of possible values is [0,3] as explained in:
> > +
> > +	       so it's false possitive with -O1 and lower. */
> "positive" (for all such comments).  Also note there should be two spaces 
> at the end of a comment between "." and the trailing "*/".

OK, will update.

> Are you sure about the "and lower", or is this warning disabled for -O0?

I'm pretty sure that -ftree-vrp isn't enabled with -O0, but will retry
if it also shows this warning with -O0.

> (glibc disallows building with -O0 at present, but I think we *should* fix 
> things to be able to build with -O0, because being able to build with -O0 
> would be helpful for debugging - any particular pieces needing 
> optimization should then just have it force-enabled, or functions declared 
> as always_inline, or whatever is needed, locally.)

I agree, but I'm not volunteering to fix all of -O0 issues reported in
[BZ #19444], my motivation was just to fix debug builds in Yocto which
is by default using -O (and issues with -Os which I'm using for some of
my builds):

is out of my league and time I'm willing to spend, I'll leave it to
someone more knowledgable about glibc internals.

Martin 'JaMa' Jansa     jabber:

Attachment: signature.asc
Description: Digital signature

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