[llvm-bugs] [Bug 32708] New: The shift didn't carry out the value in bit-field structure
llvm-bugs at lists.llvm.org
Wed Apr 19 00:00:29 PDT 2017
Bug ID: 32708
Summary: The shift didn't carry out the value in bit-field
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: shiva0217 at gmail.com
CC: llvm-bugs at lists.llvm.org
According to C99 188.8.131.52
9 A bit-field is interpreted as a signed or unsigned integer type consisting of
the specified number of bits.
So the bit exceed the number of bits after shift should carry out.
In the following case,
x.b:40 initial as 0x0100 should carry out to 0 after (x.b<<32)
unsigned long long b:40;
extern void abort (void);
void test1(unsigned long long res)
/* The shift is carried out in 40 bit precision. */
if (x.b<<32 != res)
x.b = 0x0100;
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs