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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:f65af1eeef670f2c249b1896726ef57bbf65fe2f

commit r14-937-gf65af1eeef670f2c249b1896726ef57bbf65fe2f
Author: Andrew Pinski <apin...@marvell.com>
Date:   Tue May 16 14:34:05 2023 -0700

    Fix PR 106900: array-bounds warning inside simplify_builtin_call

    The problem here is that VRP cannot figure out isize could not be 0
    due to using integer_zerop. This patch removes the use of integer_zerop
    and instead checks for 0 directly after converting the tree to
    an unsigned HOST_WIDE_INT. This allows VRP to figure out isize is not 0
    and `isize - 1` will always be >= 0.

    This patch is just to avoid the warning that GCC could produce sometimes
    and does not change any code generation or even VRP.

    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

    gcc/ChangeLog:

            * tree-ssa-forwprop.cc (simplify_builtin_call): Check
            against 0 instead of calling integer_zerop.

Reply via email to