[Bug middle-end/71907] [6/7 regression] missing buffer overflow warnings with -flto
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 18 10:03:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71907
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is that the BLOCK of the call is one w/o an abstract origin (its
supercontext is the inline-BLOCK). This is because LTO drops all abstract
origins but FUNCTION_DECLs (aka inlined_function_outer_scope_p).
This has been this way in GCC 5 as well but I suppose we were lucky to drop
the inner BLOCK there for some reason. In fact the situation was the same
there we just failed to preserve the in-system-header bit of the location:
In function ‘strcpy’,
inlined from ‘main’ at /tmp/t.c:5:5:
/usr/include/bits/string3.h:104:10: warning: call to __builtin___memcpy_chk
will always overflow destination buffer
return __builtin___strcpy_chk (__dest, __src, __bos (__dest));
^
More information about the Gcc-bugs
mailing list