https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67433
--- Comment #8 from xuejuncao <xuejuncao at gmail dot com> --- thanks, i get the below result with -fsanitize=undefined boolmagic.c:12:16: runtime error: load of value 255, which is not a valid value for type '_Bool' boolmagic.c:13:15: runtime error: load of value 255, which is not a valid value for type '_Bool' boolmagic.c:14:15: runtime error: load of value 255, which is not a valid value for type '_Bool' b = 1, i = 1, j = 1 but, can i say the "-fsanitize=undefined" will _corrects_ the undefined behaviour? or replace the code by if/else, which works fine (lucky?) int i; // = (u.b ? 1 : 0); if (u.b) i = 1; else i = 0;