https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94189
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- const char a[] = { 'a', 'b', 'c', 'd' }; int foo (void) { return __builtin_strnlen (a, 5); } and this one doesn't generate different code between -O2 -g and -O2, but FAILs with -fcompare-debug because that one does add -w to the second invocation in order not to emit all the warnings twice, and apparently the code generation in this case is dependent on whether the warning is emitted or not.