On Sat, Jan 20, 2018 at 07:57:55PM +1100, Bruce Evans wrote:
> The not-unused x86 arch is one that does this. IIRC, some history of this
> is:
>
> - on the 8086, the shift count was taken mod 32. 16 bits was enough for
>anyone, and shifting left or right by 16 through 31 (but not by 32)
>
On Fri, 19 Jan 2018, Don Lewis wrote:
On 19 Jan, Conrad Meyer wrote:
On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes
wrote:
If you think in assembler it is easy to understand why this is UB,
most (all) architectures Right Logic or Arithmetic Shift only accept an
operand that is a size that
Conrad Meyer cem at freebsd.org wrote on
Fri Jan 19 05:07:22 UTC 2018 :
> The spec says the behavior is undefined; not that the compiler has to
> produce a warning or error message. The compiler *does* get to
> arbitrarily decide what it wants to do when it encounters UB. It is
> wholly free to
On 19 Jan, Conrad Meyer wrote:
> On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes
> wrote:
>> If you think in assembler it is easy to understand why this is UB,
>> most (all) architectures Right Logic or Arithmetic Shift only accept an
>> operand that is a size that can hold log2(wordsize).
>
>
On 19 Jan, David Chisnall wrote:
> On 19 Jan 2018, at 05:07, Conrad Meyer wrote:
>>
>> The spec says the behavior is undefined; not that the compiler has to
>> produce a warning or error message. The compiler *does* get to
>> arbitrarily decide what it wants to do when it encounters UB. It is
>
Andriy Gapon avg at FreeBSD.org wrote on
Fri Jan 19 18:41:07 UTC 2018 :
> On 19/01/2018 20:30, Conrad Meyer wrote:
> > On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes
> > wrote:
> >> If you think in assembler it is easy to understand why this is UB,
> >> most (all) architectures Right Logic or
[ Charset UTF-8 unsupported, converting... ]
> On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote:
> > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote:
> >> The logical result of a right shift >= the width of a type is zero, but
> >> our
> >> compiler decides this is a warning (an
On Fri, Jan 19, 2018 at 11:31 AM, Conrad Meyer wrote:
> On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote:
> > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote:
> >> The logical result of a right shift >= the width of a type is zero,
> but our
> >> compiler decides this is a warn
On 19/01/2018 20:30, Conrad Meyer wrote:
> On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes
> wrote:
>> If you think in assembler it is easy to understand why this is UB,
>> most (all) architectures Right Logic or Arithmetic Shift only accept an
>> operand that is a size that can hold log2(wordsi
> On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote:
> > Author: cem
> > Date: Fri Jan 19 04:34:06 2018
> > New Revision: 328159
> > URL: https://svnweb.freebsd.org/changeset/base/328159
> >
> > Log:
> > Unbreak i386 build
> >
> > The logical result of a right shift >= the width of
On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes
wrote:
> If you think in assembler it is easy to understand why this is UB,
> most (all) architectures Right Logic or Arithmetic Shift only accept an
> operand that is a size that can hold log2(wordsize).
This is a logical right shift by a constan
On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote:
> On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote:
>> The logical result of a right shift >= the width of a type is zero, but our
>> compiler decides this is a warning (and thus, error). Just remove ccp(4)
>> from i386.
>
> You
On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote:
> Author: cem
> Date: Fri Jan 19 04:34:06 2018
> New Revision: 328159
> URL: https://svnweb.freebsd.org/changeset/base/328159
>
> Log:
> Unbreak i386 build
>
> The logical result of a right shift >= the width of a type is zero, but
[ Charset UTF-8 unsupported, converting... ]
> On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall wrote:
> > In C, a right-shift of a signed type propagates the sign bit. Right
> > shifting a negative 32-bit int by 16 and then again by 16 is not undefined
> > behaviour (though doing the shift as a
On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall wrote:
> In C, a right-shift of a signed type propagates the sign bit. Right shifting
> a negative 32-bit int by 16 and then again by 16 is not undefined behaviour
> (though doing the shift as a single operation is) and will give you a value
> of
On 19 Jan 2018, at 05:07, Conrad Meyer wrote:
>
> The spec says the behavior is undefined; not that the compiler has to
> produce a warning or error message. The compiler *does* get to
> arbitrarily decide what it wants to do when it encounters UB. It is
> wholly free to implement this particul
On 2018-Jan-18 21:07:19 -0800, Conrad Meyer wrote:
>The spec says the behavior is undefined; not that the compiler has to
>produce a warning or error message. The compiler *does* get to
>arbitrarily decide what it wants to do when it encounters UB. It is
>wholly free to implement this particular
The spec says the behavior is undefined; not that the compiler has to
produce a warning or error message. The compiler *does* get to
arbitrarily decide what it wants to do when it encounters UB. It is
wholly free to implement this particular UB with the logical result
and no warning/error.
On Th
No. It is the only logical result of a logical right shift larger
than the left operand. The C standard may claim that is undefined,
but that does not change the only logical result (zero).
On Thu, Jan 18, 2018 at 8:38 PM, Benjamin Kaduk wrote:
> On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer
On Thu, Jan 18, 2018 at 10:49 PM, Conrad Meyer wrote:
> No. It is the only logical result of a logical right shift larger
> than the left operand. The C standard may claim that is undefined,
> but that does not change the only logical result (zero).
>
>
My point is that the compiler does not ar
On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer wrote:
> Author: cem
> Date: Fri Jan 19 04:34:06 2018
> New Revision: 328159
> URL: https://svnweb.freebsd.org/changeset/base/328159
>
> Log:
> Unbreak i386 build
>
> The logical result of a right shift >= the width of a type is zero, but
> our
>
Author: cem
Date: Fri Jan 19 04:34:06 2018
New Revision: 328159
URL: https://svnweb.freebsd.org/changeset/base/328159
Log:
Unbreak i386 build
The logical result of a right shift >= the width of a type is zero, but our
compiler decides this is a warning (and thus, error). Just remove ccp(
22 matches
Mail list logo