[Bug tree-optimization/84480] Unexpected -Wstringop-truncation on strncpy with string literal at -O2

2018-02-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84480 Martin Sebor changed: What|Removed |Added Keywords||diagnostic

[Bug tree-optimization/84480] Unexpected -Wstringop-truncation on strncpy with string literal at -O2

2018-02-21 Thread romain.geissler at amadeus dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84480 --- Comment #1 from Romain Geissler --- Hi, I looked at the code. Actually all happens in tree-ssa-strlen.c, you have both handle_builtin_stxncpy and maybe_diag_stxncpy_trunc. It happens that the logic where you look at the next statement to