https://gcc.gnu.org/g:9a60db69ed6ab56a31027f1d509734362899c7e8

commit r16-1863-g9a60db69ed6ab56a31027f1d509734362899c7e8
Author: Ghjuvan Lacambre <lacam...@adacore.com>
Date:   Fri May 9 11:20:18 2025 +0200

    ada: freeze.adb: do not emit error on non-aligned component in CodePeer_Mode
    
    These errors hinder analysis of non-GNAT code and are not useful to the
    user as CodePeer does not care about alignment.
    
    gcc/ada/ChangeLog:
    
            * freeze.adb (Freeze_Record_Type): Check for CodePeer_Mode.

Diff:
---
 gcc/ada/freeze.adb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index cf01102f073c..be2115a90867 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -5451,9 +5451,12 @@ package body Freeze is
                      Set_Must_Be_On_Byte_Boundary (Rec);
 
                      --  Check for component clause that is inconsistent with
-                     --  the required byte boundary alignment.
+                     --  the required byte boundary alignment. Do not do this
+                     --  in CodePeer_Mode, as we do not have sufficient info
+                     --  on size and representation clauses.
 
-                     if Present (CC)
+                     if not CodePeer_Mode
+                       and then Present (CC)
                        and then Normalized_First_Bit (Comp) mod
                                   System_Storage_Unit /= 0
                      then

Reply via email to