tree.c (fld_type_variant): Also copy alignment; be sure that new variant is equal.
authorJan Hubicka <jh@suse.cz>
Tue, 6 Nov 2018 13:53:22 +0000 (14:53 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 6 Nov 2018 13:53:22 +0000 (13:53 +0000)
* tree.c (fld_type_variant): Also copy alignment; be sure that
new variant is equal.

From-SVN: r265845

gcc/ChangeLog
gcc/tree.c

index eb09970..8dd1470 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-06  Jan Hubicka  <jh@suse.cz>
+
+       * tree.c (fld_type_variant): Also copy alignment; be sure that
+       new variant is equal.
+
 2018-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>
 
        PR target/87762
index a6b187c..94a7c9c 100644 (file)
@@ -5119,6 +5119,8 @@ fld_type_variant (tree first, tree t, struct free_lang_data_d *fld)
   TYPE_NAME (v) = TYPE_NAME (t);
   TYPE_ATTRIBUTES (v) = TYPE_ATTRIBUTES (t);
   TYPE_CANONICAL (v) = TYPE_CANONICAL (t);
+  SET_TYPE_ALIGN (v, TYPE_ALIGN (t));
+  gcc_checking_assert (fld_type_variant_equal_p (t,v));
   add_tree_to_fld_list (v, fld);
   return v;
 }