aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2021-12-29 04:10:46 -0300
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-10 08:19:30 +0000
commit3b3bd801520e707d113c0f81e028abae023c4d3a (patch)
tree0f0f231dd2436103c1feda325aa43a39ddae2d14 /libgo
parentbf687b8085403b94209269e15491f286644ec10b (diff)
downloadgcc-3b3bd801520e707d113c0f81e028abae023c4d3a.zip
gcc-3b3bd801520e707d113c0f81e028abae023c4d3a.tar.gz
gcc-3b3bd801520e707d113c0f81e028abae023c4d3a.tar.bz2
[Ada] Optimize nonstandard boolean validity checking
Validity checking of enumerations with nonstandard representation starts by checking the value range, then calling _rep_to_pos to verify that the value itself is valid. The value range check is thus redundant and inefficient: the _rep_to_pos call is normally inlined when optimizing for speed and the range check slows down the fast path; it is unnecesary and undesirable when optimizing for size, and just unnecessary when not optimizing. This patch thus drops the range check for nonstandard boolean types. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Valid>: Drop redundant range check for nonstandard booleans.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions