https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98228

--- Comment #13 from Marius Hillenbrand <mhillen at linux dot ibm.com> ---
gnat applies different choices for the calling convention on x86 and s390 for
Get_Next_Interp. though, by massaging gcc/ada/sem_type.ads, I got them to
produce the same GIMPLE. while compiling sem_type.adb, I see the same results
from ipa-modref on s390x and x86-64 (as far as covered in dumps from
-fdump-ipa-modref-all) yet, the miscompile does not reproduce on x86-64. so, it
could be the serialization/deserialization of the ipa-modref info or how that
information is used during lto.


Coercing same calling convention on x86-64:

diff --git a/gcc/ada/sem_type.ads b/gcc/ada/sem_type.ads
index 6c6d5eb7fb5..a1d4b9bf60f 100644
--- a/gcc/ada/sem_type.ads
+++ b/gcc/ada/sem_type.ads
@@ -146,6 +146,9 @@ package Sem_Type is
    --  was set by a previous call to Get_First_Interp or Get_Next_Interp, the
    --  next interpretation is placed in It, and I is updated for the next
call.
    --  The end of the list of interpretations is signalled by It.Nam = Empty.
+   pragma Export (C, Get_Next_Interp);
+   pragma Export_Procedure (Get_Next_Interp,
+           Mechanism => (I => Value, It => Reference));

Reply via email to