]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
check.ads, [...] (Install_Null_Excluding_Check): No check in interface thunks since...
authorJavier Miranda <miranda@adacore.com>
Thu, 11 Apr 2013 15:26:40 +0000 (15:26 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 11 Apr 2013 15:26:40 +0000 (17:26 +0200)
2013-04-11  Javier Miranda  <miranda@adacore.com>

* check.ads, exp_ch6.adb (Install_Null_Excluding_Check): No check in
interface thunks since it is performed at the caller side.
(Expand_Simple_Function_Return): No accessibility check needed in thunks
since the check is done by the target routine.

From-SVN: r197810

gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/exp_ch6.adb

index a691ec2168d256e8b3d91cd0bd69ccbe511aeddc..53784aa4733144479a0c571c9c33087285350a2b 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-11  Javier Miranda  <miranda@adacore.com>
+
+       * check.ads, exp_ch6.adb (Install_Null_Excluding_Check): No check in
+       interface thunks since it is performed at the caller side.
+       (Expand_Simple_Function_Return): No accessibility check needed in thunks
+       since the check is done by the target routine.
+
 2013-04-11  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_prag.adb (Analyze_Pragma, case Priority): pre-analyze
index 640f0127c3cb4cbb58f77eacd7f50c157f84b4b5..39325af1e25215538b69d781104cb93a0f79d3f4 100644 (file)
@@ -6583,6 +6583,13 @@ package body Checks is
          return;
       end if;
 
+      --  No check needed in interface thunks since the runtime check is
+      --  already performed at the caller side.
+
+      if Is_Thunk (Current_Scope) then
+         return;
+      end if;
+
       --  No check needed for the Get_Current_Excep.all.all idiom generated by
       --  the expander within exception handlers, since we know that the value
       --  can never be null.
index 85dc076bacd6392afc39050876970c728d851f79..5c5c809e880faa057e52ca7bd136bad8d04dd5bc 100644 (file)
@@ -7485,12 +7485,16 @@ package body Exp_Ch6 is
       --  return expression has a specific type whose level is known not to
       --  be statically deeper than the function's result type.
 
+      --  No runtime check needed in interface thunks since it is performed
+      --  by the target primitive associated with the thunk.
+
       --  Note: accessibility check is skipped in the VM case, since there
       --  does not seem to be any practical way to implement this check.
 
       elsif Ada_Version >= Ada_2005
         and then Tagged_Type_Expansion
         and then Is_Class_Wide_Type (R_Type)
+        and then not Is_Thunk (Current_Scope)
         and then not Scope_Suppress.Suppress (Accessibility_Check)
         and then
           (Is_Class_Wide_Type (Etype (Exp))