]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add missing runtime procedure for CHERI
authorRonan Desplanques <desplanques@adacore.com>
Thu, 9 Oct 2025 08:11:43 +0000 (10:11 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:16 +0000 (15:15 +0100)
A recent patch added a procedure in the spec of System.Stream_Attributes
but failed to add the corresponding body in the CHERI-specific body of
this package. This patch fixes this.

gcc/ada/ChangeLog:

* libgnat/s-stratt__cheri.adb (W_80IEEE): New procedure.

gcc/ada/libgnat/s-stratt__cheri.adb

index aefb8b389caf590db934294c43754bea326a4dad..9e336f312e92a869376085c601fec1639216d720 100644 (file)
@@ -1016,4 +1016,21 @@ package body System.Stream_Attributes is
       Ada.Streams.Write (Stream.all, From_WWC (Item));
    end W_WWC;
 
+   procedure W_80IEEE (Stream : not null access RST; Item : Long_Long_Float) is
+   begin
+      if XDR_Support then
+         XDR.W_LLF (Stream, Item);
+         return;
+      end if;
+
+      declare
+         X : S_LLF := From_LLF (Item);
+
+         N_IEEE_Extended_Precision_Bytes : constant := 10;
+      begin
+         X (N_IEEE_Extended_Precision_Bytes + 1 .. X'Last) := (others => 0);
+         Ada.Streams.Write (Stream.all, X);
+      end;
+   end W_80IEEE;
+
 end System.Stream_Attributes;