This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Avoid spurious errors on dimensionality checking in GNATprove


In the special GNATprove mode of the frontend, automatic inlining is
performed, which may lead to spurious errors on dimensionality checking.
Avoid performing this checking on inlined code, which has already been
checked for dimensionality errors.

There is no impact on compilation.

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

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Call): Do not perform dimensionality
	checking on inlined bodies.
--- gcc/ada/sem_res.adb
+++ gcc/ada/sem_res.adb
@@ -6949,7 +6949,9 @@ package body Sem_Res is
       --  Check the dimensions of the actuals in the call. For function calls,
       --  propagate the dimensions from the returned type to N.
 
-      Analyze_Dimension_Call (N, Nam);
+      if not In_Inlined_Body then
+         Analyze_Dimension_Call (N, Nam);
+      end if;
 
       --  All done, evaluate call and deal with elaboration issues
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]