[Ada] Properly set TYPE_SIZES_GIMPLIFIED

Message ID 3126527.eqxgnlxT6s@polaris
State New
Headers show
Series
  • [Ada] Properly set TYPE_SIZES_GIMPLIFIED
Related show

Commit Message

Eric Botcazou June 29, 2019, 7:39 a.m.
Another example in the series "how can this have worked for so long?"...

Tested on x86-64/Linux, applied on all active branches.


2019-06-29  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
	the main variant of a type, if any.

-- 
Eric Botcazou

Patch

Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c	(revision 272633)
+++ gcc-interface/trans.c	(working copy)
@@ -9042,8 +9042,9 @@  mark_visited_r (tree *tp, int *walk_subt
   else if (!TYPE_IS_DUMMY_P (t))
     TREE_VISITED (t) = 1;
 
+  /* The test in gimplify_type_sizes is on the main variant.  */
   if (TYPE_P (t))
-    TYPE_SIZES_GIMPLIFIED (t) = 1;
+    TYPE_SIZES_GIMPLIFIED (TYPE_MAIN_VARIANT (t)) = 1;
 
   return NULL_TREE;
 }