]> gcc.gnu.org Git - gcc.git/commit
Fix PR 106900: array-bounds warning inside simplify_builtin_call
authorAndrew Pinski <apinski@marvell.com>
Tue, 16 May 2023 21:34:05 +0000 (14:34 -0700)
committerAndrew Pinski <apinski@marvell.com>
Wed, 17 May 2023 14:58:42 +0000 (07:58 -0700)
commitf65af1eeef670f2c249b1896726ef57bbf65fe2f
tree8bbe0644abe22c89e3b77605237847c7981dd1b7
parent01d62e9b6c3e9fd3132f1616843103ccf81778ed
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.
gcc/tree-ssa-forwprop.cc
This page took 0.055756 seconds and 5 git commands to generate.