From: Jakub Jelinek Date: Thu, 7 Feb 2013 17:38:33 +0000 (+0100) Subject: re PR c++/56237 (ICE in lang_* check: failed in push_local_name, at cp/decl.c:924) X-Git-Tag: upstream/12.2.0~71356 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6d7b956dbae9a91e493e7426802c63ef2322e77;p=platform%2Fupstream%2Fgcc.git re PR c++/56237 (ICE in lang_* check: failed in push_local_name, at cp/decl.c:924) PR c++/56237 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t) only if DECL_DISCRIMINATOR_SET_P (t) rather than just DECL_LANG_SPECIFIC (t). * g++.dg/abi/mangle61.C: New test. From-SVN: r195858 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9665be4..afaec89 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2013-02-07 Jakub Jelinek + + PR c++/56237 + * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t) + only if DECL_DISCRIMINATOR_SET_P (t) rather than just + DECL_LANG_SPECIFIC (t). + 2013-02-07 Jason Merrill PR c++/56235 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index cfee0f8..5317fcf 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -920,7 +920,7 @@ push_local_name (tree decl) if (!DECL_LANG_SPECIFIC (decl)) retrofit_lang_decl (decl); DECL_LANG_SPECIFIC (decl)->u.base.u2sel = 1; - if (DECL_LANG_SPECIFIC (t)) + if (DECL_DISCRIMINATOR_SET_P (t)) DECL_DISCRIMINATOR (decl) = DECL_DISCRIMINATOR (t) + 1; else DECL_DISCRIMINATOR (decl) = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95b4bf6..67c5ccc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-02-07 Jakub Jelinek + + PR c++/56237 + * g++.dg/abi/mangle61.C: New test. + 2013-02-07 Vladimir Makarov PR rtl-optimization/56225 diff --git a/gcc/testsuite/g++.dg/abi/mangle61.C b/gcc/testsuite/g++.dg/abi/mangle61.C new file mode 100644 index 0000000..2ae336e --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle61.C @@ -0,0 +1,28 @@ +// PR c++/56237 +// { dg-do compile } + +void *p[4]; + +void +foo () +{ + static union { } u; + p[0] = &u; + { + static union { } u; + p[1] = &u; + { + static union { } u; + p[2] = &u; + } + } + { + static union { } u; + p[3] = &u; + } +} + +// { dg-final { scan-assembler "_ZZ3foovE1u\[^_\]" } } +// { dg-final { scan-assembler "_ZZ3foovE1u_0" } } +// { dg-final { scan-assembler "_ZZ3foovE1u_1" } } +// { dg-final { scan-assembler "_ZZ3foovE1u_2" } }