[Bug tree-optimization/89550] [8/9 Regression] Spurious array-bounds warning when using __PRETTY_FUNCTION__ as a string_view

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 7 11:30:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89550

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 45916
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45916&action=edit
gcc9-pr89550.patch

While investigating why r264868 didn't warn even when the IL is pretty much the
same, I've found that it is because c_strlen was called with a different
location (from system header) during ccp and without -Wsystem-headers it set
TREE_NO_WARNING, yet hasn't emitted any warnings, and then later on it would
warn, but doesn't, because TREE_NO_WARNING was set.

This patch fixes all such spots I found, I guess it might cause more warnings
generally, will see what it does in the testsuite.


More information about the Gcc-bugs mailing list