+2019-04-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90108
+ * c-decl.c (merge_decls): If remove is main variant and
+ DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
+ variant that has newdecl as TYPE_NAME if any.
+
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
{
tree remove = TREE_TYPE (newdecl);
if (TYPE_MAIN_VARIANT (remove) == remove)
- gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
+ {
+ gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
+ /* If remove is the main variant, no need to remove that
+ from the list. One of the DECL_ORIGINAL_TYPE
+ variants, e.g. created for aligned attribute, might still
+ refer to the newdecl TYPE_DECL though, so remove that one
+ in that case. */
+ if (DECL_ORIGINAL_TYPE (newdecl)
+ && DECL_ORIGINAL_TYPE (newdecl) != remove)
+ for (tree t = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (newdecl));
+ t; t = TYPE_MAIN_VARIANT (t))
+ if (TYPE_NAME (TYPE_NEXT_VARIANT (t)) == newdecl)
+ {
+ TYPE_NEXT_VARIANT (t)
+ = TYPE_NEXT_VARIANT (TYPE_NEXT_VARIANT (t));
+ break;
+ }
+ }
else
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
+2019-04-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90108
+ * decl.c (duplicate_decls): If remove is main variant and
+ DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
+ variant that has newdecl as TYPE_NAME if any.
+
2019-04-18 Jason Merrill <jason@redhat.com>
PR c++/87554 - ICE with extern template and reference member.
{
tree remove = TREE_TYPE (newdecl);
if (TYPE_MAIN_VARIANT (remove) == remove)
- gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
+ {
+ gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
+ /* If remove is the main variant, no need to remove that
+ from the list. One of the DECL_ORIGINAL_TYPE
+ variants, e.g. created for aligned attribute, might still
+ refer to the newdecl TYPE_DECL though, so remove that one
+ in that case. */
+ if (tree orig = DECL_ORIGINAL_TYPE (newdecl))
+ if (orig != remove)
+ for (tree t = TYPE_MAIN_VARIANT (orig); t;
+ t = TYPE_MAIN_VARIANT (t))
+ if (TYPE_NAME (TYPE_NEXT_VARIANT (t)) == newdecl)
+ {
+ TYPE_NEXT_VARIANT (t)
+ = TYPE_NEXT_VARIANT (TYPE_NEXT_VARIANT (t));
+ break;
+ }
+ }
else
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
+2019-04-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90108
+ * c-c++-common/pr90108.c: New test.
+
2019-04-18 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/85164
--- /dev/null
+/* PR c++/90108 */
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-heapsize=0" } */
+
+typedef unsigned int a __attribute__ ((__aligned__(8), __may_alias__));
+typedef unsigned int a __attribute__ ((__aligned__(8), __may_alias__));