aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2024-08-20 17:35:24 -0700
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-09-03 10:16:28 +0200
commit1ef11f4bed8eb230f04e5fb09741ae6444ca3e7b (patch)
tree64781cd7e9af04a6a90d06fb3f241b3c1d1609f0 /gcc/fold-const.cc
parentd7e110d8fa18f734058e73424c398d8c69fcb6b3 (diff)
downloadgcc-1ef11f4bed8eb230f04e5fb09741ae6444ca3e7b.zip
gcc-1ef11f4bed8eb230f04e5fb09741ae6444ca3e7b.tar.gz
gcc-1ef11f4bed8eb230f04e5fb09741ae6444ca3e7b.tar.bz2
ada: Transform Length attribute references for non-Strict overflow mode.
The non-strict overflow checking code does a better job of eliminating overflow checks if given an expression consisting only of predefined operators (including relationals), literals, identifiers, and conditional expressions. If it is both feasible and useful, rewrite a Length attribute reference as such an expression. "Feasible" means "index type is same type as attribute reference type, so we can rewrite without using type conversions". "Useful" means "Overflow_Mode is something other than Strict, so there is value in making overflow check elimination easier". gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): If it makes sense to do so, then rewrite a Length attribute reference as an equivalent conditional expression.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions