]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix spurious error on unchecked conversion on VFA record type
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:46:45 +0000 (14:46 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:46:45 +0000 (14:46 +0000)
2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* gcc-interface/trans.c (Call_to_gnu): Always suppress an
unchecked conversion around the actual for an In parameter
passed by copy.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263718 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/trans.c

index 27bb79d5017211edb92ab61e56a513a5a1059ae1..e882e39602be7befacffb3d5ff6f635fe8b60d77 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/trans.c (Call_to_gnu): Always suppress an
+       unchecked conversion around the actual for an In parameter
+       passed by copy.
+
 2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
 
        * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
index 0371d00fce18910acd8e3f4a09c997d9a3b9bcca..940bf5f3b3f78cd3fe1ded9bf3ffdb121161b1e5 100644 (file)
@@ -4450,6 +4450,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
       const bool suppress_type_conversion
        = ((Nkind (gnat_actual) == N_Unchecked_Type_Conversion
            && (!in_param
+               || !is_by_ref_formal_parm
                || (Is_Composite_Type (Underlying_Type (gnat_formal_type))
                    && !Is_Constrained (Underlying_Type (gnat_formal_type)))))
           || (Nkind (gnat_actual) == N_Type_Conversion