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 c/87028] false positive -Wstringop-truncation strncpy with global variable source string


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

--- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Wed Dec  5 23:10:08 2018
New Revision: 266833

URL: https://gcc.gnu.org/viewcvs?rev=266833&root=gcc&view=rev
Log:
        PR c/87028
        * calls.c (get_attr_nonstring_decl): Avoid setting *REF to
        SSA_NAME_VAR.
        * gcc/gimple-low.c (lower_stmt): Fold builtin calls here.
        * gimplify (maybe_fold_stmt): Avoid folding builtin calls.

        PR c/87028
        * c-c++-common/Wstringop-truncation.c: Remove xfails.
        * gcc.dg/Wstringop-truncation-5.c: New test.
        * gcc.dg/strcmpopt_1.c: Adjust.
        * gcc.dg/tree-ssa/pr79697.c: Same.

Added:
    trunk/gcc/testsuite/gcc.dg/Wstringop-truncation-5.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/calls.c
    trunk/gcc/gimple-low.c
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/Wstringop-truncation.c
    trunk/gcc/testsuite/gcc.dg/fold-bcopy.c
    trunk/gcc/testsuite/gcc.dg/strcmpopt_1.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c

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