[Ada] Avoid forced loading of System.Priority in CodePeer mode

Message ID 20200706113855.GA135662@adacore.com
State New
Headers show
Series
  • [Ada] Avoid forced loading of System.Priority in CodePeer mode
Related show

Commit Message

Pierre-Marie de Rodat July 6, 2020, 11:38 a.m.
The comment for routine Is_RTE explains that it is a more efficient
equivalent of an equality testing with routine RTE.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* checks.adb (Apply_Scalar_Range_Check): Use Is_RTE.

Patch

diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -3326,7 +3326,7 @@  package body Checks is
                         --  provide a wider range.
 
                         if not CodePeer_Mode
-                          or else Target_Typ /= RTE (RE_Priority)
+                          or else not Is_RTE (Target_Typ, RE_Priority)
                         then
                            Bad_Value;
                         end if;