This is the mail archive of the libc-alpha@sourceware.org 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:
> > +	       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
> > +	       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):
http://lists.openembedded.org/pipermail/openembedded-core/2018-September/155693.html

Fixing:
https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
is out of my league and time I'm willing to spend, I'll leave it to
someone more knowledgable about glibc internals.

Cheers,
-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

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]