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

--- Comment #4 from prathamesh3492 at gcc dot gnu.org ---
Author: prathamesh3492
Date: Wed Nov 23 10:52:25 2016
New Revision: 242745

URL: https://gcc.gnu.org/viewcvs?rev=242745&root=gcc&view=rev
Log:
2016-11-23  Richard Biener  <rguent...@suse.de>
            Prathamesh Kulkarni  <prathamesh.kulka...@linaro.rog>

        PR tree-optimization/78154
        * tree-vrp.c (gimple_stmt_nonzero_warnv_p): Return true if function
        returns it's argument and the argument is nonnull.
        * builtin-attrs.def: Define ATTR_RETURNS_NONNULL,
        ATT_RETNONNULL_NOTHROW_LEAF.
        * builtins.def (BUILT_IN_MEMPCPY): Change attribute to
        ATTR_RETNONNULL_NOTHROW_LEAF.
        (BUILT_IN_STPCPY): Likewise.
        (BUILT_IN_STPNCPY): Likewise.
        (BUILT_IN_MEMPCPY_CHK): Likewise.
        (BUILT_IN_STPCPY_CHK): Likewise.
        (BUILT_IN_STPNCPY_CHK): Likewise.
        (BUILT_IN_STRCAT): Change attribute to ATTR_RET1_NOTHROW_NONNULL_LEAF.
        (BUILT_IN_STRNCAT): Likewise.
        (BUILT_IN_STRNCPY): Likewise.
        (BUILT_IN_MEMSET_CHK): Likewise.
        (BUILT_IN_STRCAT_CHK): Likewise.
        (BUILT_IN_STRCPY_CHK): Likewise.
        (BUILT_IN_STRNCAT_CHK): Likewise.
        (BUILT_IN_STRNCPY_CHK): Likewise.

testsuite/
        * gcc.dg/tree-ssa/pr78154.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr78154.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtin-attrs.def
    trunk/gcc/builtins.def
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vrp.c

Reply via email to