Date: Sun, 9 Aug 2015 09:59:49 -0600 From: Warner Losh <imp@bsdimp.com> To: Dimitry Andric <dim@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286519 - head/contrib/binutils/gas/config Message-ID: <FE48F62E-79C9-48D6-B2EA-21544EC19C45@bsdimp.com> In-Reply-To: <201508091106.t79B6fGN078307@repo.freebsd.org> References: <201508091106.t79B6fGN078307@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Since when is LEFT shifting a signed number undefined. It is RIGHT shifting that’s undefined… Warner > On Aug 9, 2015, at 5:06 AM, Dimitry Andric <dim@FreeBSD.org> wrote: > > Author: dim > Date: Sun Aug 9 11:06:40 2015 > New Revision: 286519 > URL: https://svnweb.freebsd.org/changeset/base/286519 > > Log: > In GNU as, avoid left-shifting negative integers, which is undefined. > > MFC after: 3 days > > Modified: > head/contrib/binutils/gas/config/tc-i386.c > > Modified: head/contrib/binutils/gas/config/tc-i386.c > ============================================================================== > --- head/contrib/binutils/gas/config/tc-i386.c Sun Aug 9 10:36:25 2015 (r286518) > +++ head/contrib/binutils/gas/config/tc-i386.c Sun Aug 9 11:06:40 2015 (r286519) > @@ -914,8 +914,8 @@ fits_in_signed_long (offsetT num ATTRIBU > #ifndef BFD64 > return 1; > #else > - return (!(((offsetT) -1 << 31) & num) > - || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); > + return (!(-((offsetT) 1 << 31) & num) > + || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31)); > #endif > } /* fits_in_signed_long() */ > > [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVx3j2AAoJEGwc0Sh9sBEAbmwQAJEasQpFomXfXNppBe140ID/ yUG26/ITDXaM/EtJwQNwmeN1BYvDw0WLk/q452UF4Ov+FRWoDiMC0kv+Ngu+o37E mHsbSuGyzMnG6Jbch6h0g4sLzidIKN7Ept4JzdKkEsV24EKs6C7XHNkERFEMhqcp h4nd5wg09O6AacIu8nPP0AAwloZZLxNpE32qvxdiPRsOiY7xd4LIHTrdYpN0CrM4 5JS2yNpUlaJCWX8U/xzdtAoBZOe5KfuQhZAgFbcY3QtlSapPoOliVzpvNHbCCoa+ jCPL2sLXnZTqEjgLspPoKmqrG0eohHDfjaI8b6m+d00AJTtlJagxnT2Lm9KN3ARB 33KDUGyBIypR8EJdW5a5dbQIdgpwrIrBx3GSe70OeQWEa6OB1fQprT3TSb3Zmxd0 VRS7T++7+KCEm9VzfaX49rSA+gRgSxPFGbqotowBoF1iKI6kxtRkwgEJHO5WMfln 0djAgdYecSuzUvrWPmBPntSv5+vAvh97h5bXEAgvgpfDwr4VW/L43/FWOyLUMVsE 43mvuoiYNWeOTMxBRwitIZBc1Ax0JCjw6hggsrpMbhCL6h6qluBT3r9bvzCpl2G5 QjM8j5cuWMlzk3KfyCdkdfB77yPSrjKcPt5skhIAlimwmfEQ5EqDJcXHDPZoFZDE quHhoYYDVnyIhSSUPKjC =dzOF -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE48F62E-79C9-48D6-B2EA-21544EC19C45>
