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: Another GLIBC build error with GCC6

On Tue, 2015-07-21 at 22:56 -0700, Paul Eggert wrote:
> Roland McGrath wrote:
> > the left shift doesn't even lose any bits, because the high
> > bit is already zero (and it's a constant, so the compiler knows that).
> But it does lose a bit.  It loses a zero bit, which can't be recovered the way 
> that a non-overflowing signed left shift is recovered by shifting right the same 
> amount.
> > that's the whole point of the thing: to sign-extend the 31-bit value
> > to 32 bits.  I don't think it should complain about 0x7fffffff << 1.
> Such complaints are useful for compilers that take advantage of C's overflow 
> rules to generate efficient-but-weird code when you violate the rules (something 
> that describes GCC more and more nowadays...).
> Anyway, if I understand this one correctly it should be easy enough to fix 
> portably.  Something like the attached patch, say.  (I haven't tested it.)


This patch looks good to me and works fine on MIPS, now that the GLIBC
trunk is unfrozen do you want to check it in?  I would like to get GLIBC
building again with the latest GCC and this is one of the things that
needs fixing in order to get rid of the warnings.

Steve Ellcey

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