diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-07-11 08:01:54 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-11 08:01:54 +0000 |
commit | a081ded4df03e30cd4aefa1e946eb31aa423bfb2 (patch) | |
tree | 013e6f55feb3e4e9d186337e498d82b74d5e482c /gcc/resource.c | |
parent | dd8b4c118e15b03a9f8ca748be0c3415e8df788a (diff) | |
download | gcc-a081ded4df03e30cd4aefa1e946eb31aa423bfb2.zip gcc-a081ded4df03e30cd4aefa1e946eb31aa423bfb2.tar.gz gcc-a081ded4df03e30cd4aefa1e946eb31aa423bfb2.tar.bz2 |
[Ada] Compile-time evaluation of predicate checks
This patch recognizes case of dynamic predicates on integer subtypes
that are simple enough to be evaluated statically when the argument is
itself a literal. Even though in many cases such predicate checks will
be removed by the back-end with any level of optimization, it is
preferable to perform this constant folding in the front-end, wich also
cleans up the output of CCG, as well as producing explicit warnings when
the test will fail.
2019-07-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_ch6.adb (Can_Fold_Predicate_Call): New function,
subsidiary of Expand_Call_Helper, to compute statically a
predicate check when the argument is a static integer.
gcc/testsuite/
* gnat.dg/predicate11.adb: New testcase.
From-SVN: r273386
Diffstat (limited to 'gcc/resource.c')
0 files changed, 0 insertions, 0 deletions