https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66875
--- Comment #4 from Patrick S. <patricksung at gmail dot com> --- (In reply to Marek Polacek from comment #2) > Yes, please try -fsanitize=undefined. This looks like an invalid. I am guessing this would allow the compiler to detect the loop is undefined and would generate warning? if in that case no new warning/error was generated.