diff mbox series

[Ada] Remove Unknown_ functions

Message ID 20210708135041.GA2466039@adacore.com
State New
Headers show
Series [Ada] Remove Unknown_ functions | expand

Commit Message

Pierre-Marie de Rodat July 8, 2021, 1:50 p.m. UTC
Remove the Unknown_ type representation attribute predicates from
Einfo.Utils. "not Known_Alignment (...)" is at least as readable as
"Unknown_Alignment (...)" -- we don't need a bunch of functions that
just do a "not".

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* einfo-utils.ads, einfo-utils.adb (Unknown_Alignment,
	Unknown_Component_Bit_Offset, Unknown_Component_Size,
	Unknown_Esize, Unknown_Normalized_First_Bit,
	Unknown_Normalized_Position, Unknown_Normalized_Position_Max,
	Unknown_RM_Size): Remove these functions.
	* exp_pakd.adb, exp_util.adb, fe.h, freeze.adb, layout.adb,
	repinfo.adb, sem_ch13.adb, sem_ch3.adb, sem_util.adb: Remove
	calls to these functions; do "not Known_..." instead.
	* gcc-interface/decl.c, gcc-interface/trans.c
	(Unknown_Alignment, Unknown_Component_Size, Unknown_Esize,
	Unknown_RM_Size): Remove calls to these functions; do
	"!Known_..." instead.
diff mbox series

Patch

diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -597,46 +597,6 @@  package body Einfo.Utils is
         and then not Is_Generic_Type (E);
    end Known_Static_RM_Size;
 
-   function Unknown_Alignment                     (E : Entity_Id) return B is
-   begin
-      return not Known_Alignment (E);
-   end Unknown_Alignment;
-
-   function Unknown_Component_Bit_Offset          (E : Entity_Id) return B is
-   begin
-      return not Known_Component_Bit_Offset (E);
-   end Unknown_Component_Bit_Offset;
-
-   function Unknown_Component_Size                (E : Entity_Id) return B is
-   begin
-      return not Known_Component_Size (E);
-   end Unknown_Component_Size;
-
-   function Unknown_Esize                         (E : Entity_Id) return B is
-   begin
-      return not Known_Esize (E);
-   end Unknown_Esize;
-
-   function Unknown_Normalized_First_Bit          (E : Entity_Id) return B is
-   begin
-      return not Known_Normalized_First_Bit (E);
-   end Unknown_Normalized_First_Bit;
-
-   function Unknown_Normalized_Position           (E : Entity_Id) return B is
-   begin
-      return not Known_Normalized_Position (E);
-   end Unknown_Normalized_Position;
-
-   function Unknown_Normalized_Position_Max       (E : Entity_Id) return B is
-   begin
-      return not Known_Normalized_Position_Max (E);
-   end Unknown_Normalized_Position_Max;
-
-   function Unknown_RM_Size                       (E : Entity_Id) return B is
-   begin
-      return not Known_RM_Size (E);
-   end Unknown_RM_Size;
-
    --------------------
    -- Address_Clause --
    --------------------


diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads
--- a/gcc/ada/einfo-utils.ads
+++ b/gcc/ada/einfo-utils.ads
@@ -314,12 +314,11 @@  package Einfo.Utils is
    -- Type Representation Attribute Predicates --
    ----------------------------------------------
 
-   --  These predicates test the setting of the indicated attribute. If the
-   --  value has been set, then Known is True, and Unknown is False. If no
-   --  value is set, then Known is False and Unknown is True. The Known_Static
-   --  predicate is true only if the value is set (Known) and is set to a
-   --  compile time known value. Note that in the case of Alignment and
-   --  Normalized_First_Bit, dynamic values are not possible, so we do not
+   --  These predicates test the setting of the indicated attribute. The
+   --  Known predicate is True if and only if the value has been set. The
+   --  Known_Static predicate is True only if the value is set (Known) and is
+   --  set to a compile time known value. Note that in the case of Alignment
+   --  and Normalized_First_Bit, dynamic values are not possible, so we do not
    --  need a separate Known_Static calls in these cases. The not set (unknown)
    --  values are as follows:
 
@@ -364,15 +363,6 @@  package Einfo.Utils is
    function Known_Static_Normalized_Position_Max  (E : Entity_Id) return B;
    function Known_Static_RM_Size                  (E : Entity_Id) return B;
 
-   function Unknown_Alignment                     (E : Entity_Id) return B;
-   function Unknown_Component_Bit_Offset          (E : Entity_Id) return B;
-   function Unknown_Component_Size                (E : Entity_Id) return B;
-   function Unknown_Esize                         (E : Entity_Id) return B;
-   function Unknown_Normalized_First_Bit          (E : Entity_Id) return B;
-   function Unknown_Normalized_Position           (E : Entity_Id) return B;
-   function Unknown_Normalized_Position_Max       (E : Entity_Id) return B;
-   function Unknown_RM_Size                       (E : Entity_Id) return B;
-
    pragma Inline (Known_Alignment);
    pragma Inline (Known_Component_Bit_Offset);
    pragma Inline (Known_Component_Size);
@@ -390,15 +380,6 @@  package Einfo.Utils is
    pragma Inline (Known_Static_Normalized_Position_Max);
    pragma Inline (Known_Static_RM_Size);
 
-   pragma Inline (Unknown_Alignment);
-   pragma Inline (Unknown_Component_Bit_Offset);
-   pragma Inline (Unknown_Component_Size);
-   pragma Inline (Unknown_Esize);
-   pragma Inline (Unknown_Normalized_First_Bit);
-   pragma Inline (Unknown_Normalized_Position);
-   pragma Inline (Unknown_Normalized_Position_Max);
-   pragma Inline (Unknown_RM_Size);
-
    ---------------------------------------------------
    -- Access to Subprograms in Subprograms_For_Type --
    ---------------------------------------------------


diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -563,11 +563,11 @@  package body Exp_Pakd is
          --  Do not reset RM_Size if already set, as happens in the case of
          --  a modular type.
 
-         if Unknown_Esize (PAT) then
+         if not Known_Esize (PAT) then
             Set_Esize (PAT, PASize);
          end if;
 
-         if Unknown_RM_Size (PAT) then
+         if not Known_RM_Size (PAT) then
             Set_RM_Size (PAT, PASize);
          end if;
 


diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -9048,7 +9048,7 @@  package body Exp_Util is
 
                if Target_Strict_Alignment
                  and then Known_Alignment (Ptyp)
-                 and then (Unknown_Alignment (Styp)
+                 and then (not Known_Alignment (Styp)
                             or else Alignment (Styp) > Alignment (Ptyp))
                then
                   return True;
@@ -9072,7 +9072,7 @@  package body Exp_Util is
                begin
                   if Present (Component_Clause (Field))
                     and then
-                      (Unknown_Alignment (Styp)
+                      (not Known_Alignment (Styp)
                         or else
                          (Component_Bit_Offset (Field) mod
                            (System_Storage_Unit * Alignment (Styp))) /= 0)


diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -636,30 +636,6 @@  B Known_Static_Normalized_Position_Max  (Entity_Id E);
 #define Known_Static_RM_Size einfo__utils__known_static_rm_size
 B Known_Static_RM_Size                  (Entity_Id E);
 
-#define Unknown_Alignment einfo__utils__unknown_alignment
-B Unknown_Alignment                     (Entity_Id E);
-
-#define Unknown_Component_Bit_Offset einfo__utils__unknown_component_bit_offset
-B Unknown_Component_Bit_Offset          (Entity_Id E);
-
-#define Unknown_Component_Size einfo__utils__unknown_component_size
-B Unknown_Component_Size                (Entity_Id E);
-
-#define Unknown_Esize einfo__utils__unknown_esize
-B Unknown_Esize                         (Entity_Id E);
-
-#define Unknown_Normalized_First_Bit einfo__utils__unknown_normalized_first_bit
-B Unknown_Normalized_First_Bit          (Entity_Id E);
-
-#define Unknown_Normalized_Position einfo__utils__unknown_normalized_position
-B Unknown_Normalized_Position           (Entity_Id E);
-
-#define Unknown_Normalized_Position_Max einfo__utils__unknown_normalized_position_max
-B Unknown_Normalized_Position_Max       (Entity_Id E);
-
-#define Unknown_RM_Size einfo__utils__unknown_rm_size
-B Unknown_RM_Size                       (Entity_Id E);
-
 #define Is_Discrete_Or_Fixed_Point_Type einfo__utils__is_discrete_or_fixed_point_type
 B Is_Discrete_Or_Fixed_Point_Type     (E Id);
 


diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -857,7 +857,7 @@  package body Freeze is
 
          --  Set size if not set already
 
-         elsif Unknown_RM_Size (T) then
+         elsif not Known_RM_Size (T) then
             Set_RM_Size (T, S);
          end if;
       end Set_Small_Size;
@@ -1043,7 +1043,7 @@  package body Freeze is
                   if not Is_Constrained (T)
                     and then
                       No (Discriminant_Default_Value (First_Discriminant (T)))
-                    and then Unknown_RM_Size (T)
+                    and then not Known_RM_Size (T)
                   then
                      return False;
                   end if;
@@ -3480,7 +3480,7 @@  package body Freeze is
          else
             --  Acquire alignment from base type
 
-            if Unknown_Alignment (Arr) then
+            if not Known_Alignment (Arr) then
                Set_Alignment (Arr, Alignment (Base_Type (Arr)));
                Adjust_Esize_Alignment (Arr);
             end if;
@@ -8632,7 +8632,7 @@  package body Freeze is
 
       --  If Esize of a subtype has not previously been set, set it now
 
-      if Unknown_Esize (Typ) then
+      if not Known_Esize (Typ) then
          Atype := Ancestor_Subtype (Typ);
 
          if Present (Atype) then
@@ -9127,7 +9127,7 @@  package body Freeze is
 
       --  Set Esize to calculated size if not set already
 
-      if Unknown_Esize (Typ) then
+      if not Known_Esize (Typ) then
          Init_Esize (Typ, Actual_Size);
       end if;
 


diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -444,7 +444,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 
   /* The RM size must be specified for all discrete and fixed-point types.  */
   gcc_assert (!(Is_In_Discrete_Or_Fixed_Point_Kind (kind)
-		&& Unknown_RM_Size (gnat_entity)));
+		&& !Known_RM_Size (gnat_entity)));
 
   /* If we get here, it means we have not yet done anything with this entity.
      If we are not defining it, it must be a type or an entity that is defined
@@ -2324,7 +2324,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 
 	/* If Component_Size is not already specified, annotate it with the
 	   size of the component.  */
-	if (Unknown_Component_Size (gnat_entity))
+	if (!Known_Component_Size (gnat_entity))
 	  Set_Component_Size (gnat_entity,
                               annotate_value (TYPE_SIZE (comp_type)));
 
@@ -4369,7 +4369,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
       set_rm_size (RM_Size (gnat_entity), gnu_type, gnat_entity);
 
       /* Back-annotate the alignment of the type if not already set.  */
-      if (Unknown_Alignment (gnat_entity))
+      if (!Known_Alignment (gnat_entity))
 	{
 	  unsigned int double_align, align;
 	  bool is_capped_double, align_clause;
@@ -4395,7 +4395,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 	}
 
       /* Likewise for the size, if any.  */
-      if (Unknown_Esize (gnat_entity) && TYPE_SIZE (gnu_type))
+      if (!Known_Esize (gnat_entity) && TYPE_SIZE (gnu_type))
 	{
 	  tree gnu_size = TYPE_SIZE (gnu_type);
 
@@ -4428,7 +4428,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 
 	      /* If there is neither size clause nor representation clause, the
 		 sizes need to be adjusted.  */
-	      if (Unknown_RM_Size (gnat_entity)
+	      if (!Known_RM_Size (gnat_entity)
 		  && !VOID_TYPE_P (gnu_type)
 		  && (!TYPE_FIELDS (gnu_type)
 		      || integer_zerop (bit_position (TYPE_FIELDS (gnu_type)))))
@@ -4448,7 +4448,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 	      Set_Esize (gnat_entity, annotate_value (gnu_size));
 
 	      /* Tagged types are Strict_Alignment so RM_Size = Esize.  */
-	      if (Unknown_RM_Size (gnat_entity))
+	      if (!Known_RM_Size (gnat_entity))
 		Set_RM_Size (gnat_entity, Esize (gnat_entity));
 	    }
 
@@ -4458,7 +4458,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 	}
 
       /* Likewise for the RM size, if any.  */
-      if (Unknown_RM_Size (gnat_entity) && TYPE_SIZE (gnu_type))
+      if (!Known_RM_Size (gnat_entity) && TYPE_SIZE (gnu_type))
 	Set_RM_Size (gnat_entity, annotate_value (rm_size (gnu_type)));
 
       /* If we are at global level, GCC applied variable_size to the size but
@@ -4723,11 +4723,11 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 	   && !TYPE_IS_DUMMY_P (TREE_TYPE (gnu_decl))
 	   && Present (gnat_annotate_type))
     {
-      if (Unknown_Alignment (gnat_entity))
+      if (!Known_Alignment (gnat_entity))
 	Set_Alignment (gnat_entity, Alignment (gnat_annotate_type));
-      if (Unknown_Esize (gnat_entity))
+      if (!Known_Esize (gnat_entity))
 	Set_Esize (gnat_entity, Esize (gnat_annotate_type));
-      if (Unknown_RM_Size (gnat_entity))
+      if (!Known_RM_Size (gnat_entity))
 	Set_RM_Size (gnat_entity, RM_Size (gnat_annotate_type));
     }
 
@@ -8686,7 +8686,7 @@  annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
 	gnu_type = TREE_TYPE (gnu_type);
     }
 
-  if (Unknown_Esize (gnat_entity))
+  if (!Known_Esize (gnat_entity))
     {
       if (TREE_CODE (gnu_type) == RECORD_TYPE
 	  && TYPE_CONTAINS_TEMPLATE_P (gnu_type))
@@ -8698,7 +8698,7 @@  annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
 	Set_Esize (gnat_entity, annotate_value (size));
     }
 
-  if (Unknown_Alignment (gnat_entity))
+  if (!Known_Alignment (gnat_entity))
     Set_Alignment (gnat_entity,
 		   UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
 }


diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -9273,13 +9273,13 @@  process_freeze_entity (Node_Id gnat_node)
       gnu_new = gnat_to_gnu_entity (full_view, NULL_TREE, true);
 
       /* Propagate back-annotations from full view to partial view.  */
-      if (Unknown_Alignment (gnat_entity))
+      if (!Known_Alignment (gnat_entity))
 	Set_Alignment (gnat_entity, Alignment (full_view));
 
-      if (Unknown_Esize (gnat_entity))
+      if (!Known_Esize (gnat_entity))
 	Set_Esize (gnat_entity, Esize (full_view));
 
-      if (Unknown_RM_Size (gnat_entity))
+      if (!Known_RM_Size (gnat_entity))
 	Set_RM_Size (gnat_entity, RM_Size (full_view));
 
       /* The above call may have defined this entity (the simplest example


diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb
--- a/gcc/ada/layout.adb
+++ b/gcc/ada/layout.adb
@@ -77,7 +77,7 @@  package body Layout is
    begin
       --  Nothing to do if size unknown
 
-      if Unknown_Esize (E) then
+      if not Known_Esize (E) then
          return;
       end if;
 
@@ -119,7 +119,7 @@  package body Layout is
       --  Now we have the size set, it must be a multiple of the alignment
       --  nothing more we can do here if the alignment is unknown here.
 
-      if Unknown_Alignment (E) then
+      if not Known_Alignment (E) then
          return;
       end if;
 
@@ -404,7 +404,7 @@  package body Layout is
          --  it now to a copy of the Esize if the Esize is set.
 
          else
-            if Known_Esize (E) and then Unknown_RM_Size (E) then
+            if Known_Esize (E) and then not Known_RM_Size (E) then
                Set_RM_Size (E, Esize (E));
             end if;
          end if;
@@ -425,15 +425,15 @@  package body Layout is
                PAT : constant Entity_Id := Packed_Array_Impl_Type (E);
 
             begin
-               if Unknown_Esize (E) then
+               if not Known_Esize (E) then
                   Set_Esize     (E, Esize     (PAT));
                end if;
 
-               if Unknown_RM_Size (E) then
+               if not Known_RM_Size (E) then
                   Set_RM_Size   (E, RM_Size   (PAT));
                end if;
 
-               if Unknown_Alignment (E) then
+               if not Known_Alignment (E) then
                   Set_Alignment (E, Alignment (PAT));
                end if;
             end;
@@ -446,7 +446,7 @@  package body Layout is
          --  gave up because, in this case, the object size is not a multiple
          --  of the alignment and, therefore, cannot be the component size.
 
-         if Ekind (E) = E_Array_Type and then Unknown_Component_Size (E) then
+         if Ekind (E) = E_Array_Type and then not Known_Component_Size (E) then
             declare
                CT : constant Entity_Id := Component_Type (E);
 
@@ -478,7 +478,7 @@  package body Layout is
 
          if Is_Array_Type (E)
            and then not Is_Packed (E)
-           and then Unknown_Alignment (E)
+           and then not Known_Alignment (E)
            and then Known_Alignment (Component_Type (E))
            and then Known_Static_Component_Size (E)
            and then Known_Static_Esize (Component_Type (E))
@@ -529,10 +529,10 @@  package body Layout is
                   --  explicitly by the user. In that case, also do not set
                   --  Esize.
 
-                  if Unknown_RM_Size (E) or else RM_Size (E) = Siz then
+                  if not Known_RM_Size (E) or else RM_Size (E) = Siz then
                      Set_RM_Size (E, Siz);
 
-                     if Unknown_Esize (E) then
+                     if not Known_Esize (E) then
                         Siz := ((Siz + (Abits - 1)) / Abits) * Abits;
                         Set_Esize (E, Siz);
                      end if;
@@ -576,7 +576,7 @@  package body Layout is
          --  arrays when passed to subprogram parameters (see special test
          --  in Exp_Ch6.Expand_Actuals).
 
-         if not Is_Packed (E) and then Unknown_Alignment (E) then
+         if not Is_Packed (E) and then not Known_Alignment (E) then
             if Known_Static_Component_Size (E)
               and then Component_Size (E) = 1
             then
@@ -748,7 +748,7 @@  package body Layout is
 
          if Known_Static_Esize (E) then
             Siz := Esize (E);
-         elsif Unknown_Esize (E) and then Known_Static_RM_Size (E) then
+         elsif not Known_Esize (E) and then Known_Static_RM_Size (E) then
             Siz := RM_Size (E);
          else
             return;
@@ -853,7 +853,7 @@  package body Layout is
 
                         if Calign > Align
                           and then
-                            (Unknown_Esize (Comp)
+                            (not Known_Esize (Comp)
                               or else (Known_Static_Esize (Comp)
                                         and then
                                        Esize (Comp) = Calign * SSU))
@@ -1020,7 +1020,7 @@  package body Layout is
          --  If alignment is currently not set, then we can safely set it to
          --  this new calculated value.
 
-         if Unknown_Alignment (E) then
+         if not Known_Alignment (E) then
             Init_Alignment (E, A);
 
          --  Cases where we have inherited an alignment


diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -1031,7 +1031,7 @@  package body Repinfo is
                   --  whose position is not specified have starting normalized
                   --  bit position of zero.
 
-                  if Unknown_Normalized_First_Bit (Comp)
+                  if not Known_Normalized_First_Bit (Comp)
                     and then not Is_Packed (Ent)
                   then
                      Set_Normalized_First_Bit (Comp, Uint_0);
@@ -1044,7 +1044,7 @@  package body Repinfo is
 
                   --  Complete annotation in case not done
 
-                  if Unknown_Normalized_First_Bit (Comp) then
+                  if not Known_Normalized_First_Bit (Comp) then
                      Set_Normalized_Position  (Comp, Npos);
                      Set_Normalized_First_Bit (Comp, Fbit);
                   end if;
@@ -1202,7 +1202,7 @@  package body Repinfo is
          --  No_Uint, not Uint_0. Really everyone should use No_Uint???
 
          elsif List_Representation_Info < 3
-           or else (Esize (Ent) /= Uint_0 and then Unknown_Esize (Ent))
+           or else (Esize (Ent) /= Uint_0 and then not Known_Esize (Ent))
          then
             Write_Unknown_Val;
 


diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -12370,7 +12370,7 @@  package body Sem_Ch13 is
       --  length (it may for example be appropriate to round up the size
       --  to some convenient boundary, based on alignment considerations, etc).
 
-      if Unknown_RM_Size (Rectype)
+      if not Known_RM_Size (Rectype)
         and then Hbit + 1 <= 32
         and then not Strict_Alignment (Rectype)
       then


diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -16824,7 +16824,7 @@  package body Sem_Ch3 is
       Set_Etype (Derived_Type, Implicit_Base);
       Set_Size_Info         (Derived_Type, Parent_Type);
 
-      if Unknown_RM_Size (Derived_Type) then
+      if not Known_RM_Size (Derived_Type) then
          Set_RM_Size (Derived_Type, RM_Size (Parent_Type));
       end if;
 


diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -11825,7 +11825,7 @@  package body Sem_Util is
             if Default = Known_Compatible
               or else
                 (Etype (Obj) = Etype (Expr)
-                  and then (Unknown_Alignment (Obj)
+                  and then (not Known_Alignment (Obj)
                              or else
                                Alignment (Obj) = Alignment (Etype (Obj))))
             then
@@ -12070,7 +12070,7 @@  package body Sem_Util is
       --  do it when there is an address clause since we can do more if the
       --  alignment is known.
 
-      if Unknown_Alignment (Obj) then
+      if not Known_Alignment (Obj) then
          Set_Alignment (Obj, Alignment (Etype (Obj)));
       end if;