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/83075] [8 Regression] Invalid strncpy optimization


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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Dec  6 17:47:45 2017
New Revision: 255446

URL: https://gcc.gnu.org/viewcvs?rev=255446&root=gcc&view=rev
Log:
PR tree-optimization/83075 - Invalid strncpy optimization

gcc/ChangeLog:

        PR tree-optimization/83075
        * tree-ssa-strlen.c (handle_builtin_stxncpy): Avoid assuming
        strncat/strncpy don't change length of source string.

gcc/testsuite/ChangeLog:

        PR tree-optimization/83075
        * gcc.dg/tree-ssa/strncat.c: New test.
        * gcc.dg/tree-ssa/strncpy-2.c: Same.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/strncat.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    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]