This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix PR ada/83091


This fixes a small oversight in gigi, which can lead to an inconsistency 
between type variants for the mode when packed array types are involved.

Tested on x86-64/Linux, applied on the mainline.


2017-11-23  Eric Botcazou  <ebotcazou@adacore.com>

	PR ada/83091
	* gcc-interface/decl.c (gnat_to_gnu_entity): Do not build a variant
	type for the implementation type of a packed array.

-- 
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 255106)
+++ gcc-interface/decl.c	(working copy)
@@ -4568,7 +4568,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 			     ? ALIAS_SET_COPY : ALIAS_SET_SUPERSET);
 	}
 
-      if (Treat_As_Volatile (gnat_entity))
+      /* Finally get to the appropriate variant, except for the implementation
+	 type of a packed array because the GNU type might be further adjusted
+	 when the original array type is itself processed.  */
+      if (Treat_As_Volatile (gnat_entity)
+	  && !Is_Packed_Array_Impl_Type (gnat_entity))
 	{
 	  const int quals
 	    = TYPE_QUAL_VOLATILE

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]