public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-947] [Ada] Fix spurious use of trampolines with interface types
@ 2022-06-02  9:10 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-06-02  9:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4c132238a51d407e1ab2388eaf8c6bce2fe5637f

commit r13-947-g4c132238a51d407e1ab2388eaf8c6bce2fe5637f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed May 18 11:05:33 2022 +0200

    [Ada] Fix spurious use of trampolines with interface types
    
    Function pointers must always be built with '[Unrestricted_]Access.
    
    gcc/ada/
    
            * exp_ch3.adb (Init_Secondary_Tags.Initialize_Tag): Initialize the
            Offset_Func component by means of 'Unrestricted_Access.

Diff:
---
 gcc/ada/exp_ch3.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 2f74208c401..d02a863045b 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -9506,7 +9506,7 @@ package body Exp_Ch3 is
             --       Prim_T       => Typ'Tag,
             --       Interface_T  => Iface'Tag,
             --       Offset_Value => n,
-            --       Offset_Func  => Fn'Address)
+            --       Offset_Func  => Fn'Unrestricted_Access)
 
             Append_To (Stmts_List,
               Make_Procedure_Call_Statement (Loc,
@@ -9541,7 +9541,7 @@ package body Exp_Ch3 is
                     Make_Attribute_Reference (Loc,
                       Prefix => New_Occurrence_Of
                                   (DT_Offset_To_Top_Func (Tag_Comp), Loc),
-                      Attribute_Name => Name_Address)))));
+                      Attribute_Name => Name_Unrestricted_Access)))));
 
             --  In this case the next component stores the value of the offset
             --  to the top.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02  9:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  9:10 [gcc r13-947] [Ada] Fix spurious use of trampolines with interface types Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).