[Bug tree-optimization/84468] [8 Regression] bogus -Wstringop-truncation despite assignment after conditional strncpy
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 7 19:31:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84468
--- Comment #17 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Mar 7 19:30:31 2018
New Revision: 258339
URL: https://gcc.gnu.org/viewcvs?rev=258339&root=gcc&view=rev
Log:
PR tree-optimization/84468 - bogus -Wstringop-truncation despite assignment
after conditional strncpy
gcc/ChangeLog:
PR tree-optimization/84468
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Consider successor
basic block when looking for nul assignment.
gcc/testsuite/ChangeLog:
PR tree-optimization/84468
* g++.dg/warn/Wstringop-truncation-2.C: New test.
* gcc.dg/Wstringop-truncation.c: New test.
* gcc.dg/Wstringop-truncation-2.c: New test.
Added:
trunk/gcc/testsuite/g++.dg/warn/Wstringop-truncation-2.C
trunk/gcc/testsuite/gcc.dg/Wstringop-truncation-2.c
trunk/gcc/testsuite/gcc.dg/Wstringop-truncation.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C
trunk/gcc/tree-ssa-strlen.c
More information about the Gcc-bugs
mailing list