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

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Thu Feb 22 17:35:29 2018
New Revision: 257910

URL: https://gcc.gnu.org/viewcvs?rev=257910&root=gcc&view=rev
Log:
PR tree-optimization/84480 - bogus -Wstringop-truncation despite assignment
with an inlined string literal

gcc/ChangeLog:

        PR tree-optimization/84480
        * gimple-fold.c (gimple_fold_builtin_strcpy): Move warnings
        to maybe_diag_stxncpy_trunc.  Call it.
        * tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Integrate warnings
        from gimple_fold_builtin_strcpy.  Print inlining stack.
        (handle_builtin_stxncpy): Print inlining stack.
        * tree-ssa-strlen.h (maybe_diag_stxncpy_trunc): Declare.

gcc/testsuite/ChangeLog:

        PR tree-optimization/84480
        * c-c++-common/Wstringop-truncation.c: Adjust text of expected
warnings.
        * g++.dg/warn/Wstringop-truncation-1.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C
    trunk/gcc/tree-ssa-strlen.h
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimple-fold.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/Wstringop-truncation.c
    trunk/gcc/tree-ssa-strlen.c

Reply via email to