]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/113396 - int128 array index and value-ranges
authorRichard Biener <rguenther@suse.de>
Tue, 19 Mar 2024 14:25:16 +0000 (15:25 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 20 Mar 2024 08:16:38 +0000 (09:16 +0100)
commit6a55e39bdb1fdb570730c08413ebbe744e493411
treee0acdc9253c93afc2cd5f81018073d6634fd5d93
parent994d8f922b9d88f45775f57a490409ab1c3baf59
middle-end/113396 - int128 array index and value-ranges

The following fixes bogus truncation of a value-range for an int128
array index when computing the maximum extent for a variable array
reference.  Instead of possibly slowing things down by using
widest_int the following makes sure the range bounds fit within
the constraints offset_int were designed for.

PR middle-end/113396
* tree-dfa.cc (get_ref_base_and_extent): Use index range
bounds only if they fit within the address-range constraints
of offset_int.

* gcc.dg/torture/pr113396.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr113396.c [new file with mode: 0644]
gcc/tree-dfa.cc