http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56051
Bug #: 56051 Summary: Wrong expression evaluation Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: olivier....@gmail.com #include <stdio.h> int main(void) { int a, s = 8; unsigned char data[1] = {0}; a = data[0] < (unsigned char) (1 << s); printf("%d\n", a); return 0; } The expression assigned to object a evaluates to 1 but I think it should evaluate to 0. Tested on gcc 4.7.2 / Linux x64.