This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/84468] [8 Regression] bogus -Wstringop-truncation despite assignment after conditional strncpy


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]