[Bug c/87392] UBSAN behavior on left-shifting 1 into the sign bit is dependent on C standard

2018-09-26 Thread roscaeugeniu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87392 --- Comment #8 from Eugeniu Rosca --- On 2018-09-25 at 08:53:34 UTC, Jonathan Wakely wrote in comment #6: > He already did. Comment 1 quotes the GCC manual which references > the relevant sections of the standards. Comment 1 does indeed referen

[Bug c/87392] UBSAN behavior on left-shifting 1 into the sign bit is dependent on C standard

2018-09-24 Thread roscaeugeniu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87392 --- Comment #5 from Eugeniu Rosca --- Hi Andrew, Thanks for the much more satisfying answer. > In C90, it was implemented defined behavior (while in C99 and above it is > undefined behavior). I trust you, but why not giving a reference to the

[Bug c/87392] UBSAN behavior on left-shifting 1 into the sign bit is dependent on C standard

2018-09-23 Thread roscaeugeniu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87392 Eugeniu Rosca changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID

[Bug c/87392] UBSAN behavior on left-shifting 1 into the sign bit is dependent on C standard

2018-09-23 Thread roscaeugeniu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87392 --- Comment #2 from Eugeniu Rosca --- Hi Andrew, > As an extension to the C language, GCC does not use the latitude given in C99 > and C11 only to treat certain aspects of signed ‘<<’ as undefined. However, > -fsanitize=shift (and -fsanitize=u

[Bug c/87392] New: UBSAN behavior on left-shifting 1 into the sign bit is dependent on C standard

2018-09-22 Thread roscaeugeniu at gmail dot com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: roscaeugeniu at gmail dot com Target Milestone: --- Dear GCC community, Porting GCC UBSAN support from Linux kernel to U-Boot [1], we noticed [2] that UBSAN complains about