If a pragma Compile_Time_Error contains T'Size, then T'Size can be computed as 0 instead of the correct value, causing missing or extra error messages. The same applies to pragma Compile_Time_Warning. This patch fixes that bug. Running these commands: gcc -c -g -O0 -gnata fillers-neq_error.ads gcc -c -g -O0 -gnata fillers-neq_error-main.adb On the following sources: package Fillers is Filler_Bytes : constant Long_Long_Integer := 1024 / 8; type Filler_Range is new Long_Long_Integer range 0 .. Filler_Bytes - 1; type Integer_8 is mod 2**8 with Size => 8; type Filler_Type is array (Filler_Range) of Integer_8 with Pack; end Fillers; package Fillers.Neq_Error is pragma Compile_Time_Error (Filler_Type'Size /= 1024, "Filler_Type'Size /= 1024"); end Fillers.Neq_Error; with Text_IO; use Text_IO; procedure Fillers.Neq_Error.Main is X : constant Integer := Filler_Type'Size; begin Put_Line (X'Img); end Fillers.Neq_Error.Main; Should execute silently. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-10-10 Bob Duff gcc/ada/ * sem_prag.adb (Defer_Compile_Time_Warning_Error_To_BE): In addition to saving the pragma for further processing, copy the pragma into the main unit if necessary.