]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Back out change to Tbuild.Unchecked_Convert_To
authorBob Duff <duff@adacore.com>
Fri, 27 Jun 2025 16:00:54 +0000 (12:00 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 18 Jul 2025 08:29:50 +0000 (10:29 +0200)
...because it breaks one test that uses --RTS=light.
"Is_Composite_Type" is needed; "not Is_Scalar_Type"
was wrong.

gcc/ada/ChangeLog:

* tbuild.adb (Unchecked_Convert_To): Back out
change.

gcc/ada/tbuild.adb

index b89c40851bc19865f9eddf8aa323c93081fc9fea..52fdbfc2163f3f615bcac4c999f5855ce2129950 100644 (file)
@@ -926,11 +926,11 @@ package body Tbuild is
       --  conversion of an unchecked conversion. Extra unchecked conversions
       --  make the .dg output less readable. We can't do this in cases
       --  involving bitfields, because the sizes might not match. The
-      --  "not Is_Scalar_Type" checks avoid such cases.
+      --  Is_Composite_Type checks avoid such cases.
 
       elsif Nkind (Expr) = N_Unchecked_Type_Conversion
-        and then not Is_Scalar_Type (Etype (Expr))
-        and then not Is_Scalar_Type (Typ)
+        and then Is_Composite_Type (Etype (Expr))
+        and then Is_Composite_Type (Typ)
       then
          Set_Subtype_Mark (Expr, New_Occurrence_Of (Typ, Loc));
          Result := Relocate_Node (Expr);