Commit 60a2c645 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)

	PR c/89933
c/
	* c-decl.c (merge_decls): When newdecl's type is its main variant,
	don't try to remove it from the variant list, but instead assert
	it has no variants.
cp/
	* decl.c (duplicate_decls): When newdecl's type is its main variant,
	don't try to remove it from the variant list, but instead assert
	it has no variants.
testsuite/
	* c-c++-common/pr89933.c: New test.

From-SVN: r270329
parent bb50312e
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* c-decl.c (merge_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
2019-04-01 Richard Biener <rguenther@suse.de>
PR c/71598
......
......@@ -2512,6 +2512,9 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (TYPE_NAME (TREE_TYPE (newdecl)) == newdecl)
{
tree remove = TREE_TYPE (newdecl);
if (TYPE_MAIN_VARIANT (remove) == remove)
gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
else
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
if (TYPE_NEXT_VARIANT (t) == remove)
......
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* decl.c (duplicate_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
2019-04-12 Martin Sebor <msebor@redhat.com>
PR c/88383
......
......@@ -2132,6 +2132,9 @@ next_arg:;
if (TYPE_NAME (TREE_TYPE (newdecl)) == newdecl)
{
tree remove = TREE_TYPE (newdecl);
if (TYPE_MAIN_VARIANT (remove) == remove)
gcc_assert (TYPE_NEXT_VARIANT (remove) == NULL_TREE);
else
for (tree t = TYPE_MAIN_VARIANT (remove); ;
t = TYPE_NEXT_VARIANT (t))
if (TYPE_NEXT_VARIANT (t) == remove)
......
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* c-c++-common/pr89933.c: New test.
2019-04-12 Martin Sebor <msebor@redhat.com>
PR c/88383
......
/* PR c/89933 */
/* { dg-do compile } */
typedef unsigned int a __attribute__ ((__aligned__(8), __may_alias__));
typedef unsigned int a __attribute__ ((__aligned__(8), __may_alias__));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment