diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-02-07 18:38:33 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-02-07 18:38:33 +0100 |
commit | e6d7b956dbae9a91e493e7426802c63ef2322e77 (patch) | |
tree | 1f378128e810d8b12fa7c54df0dba1651a8a6b7e | |
parent | 5306401f2a1f6b090e9b17bfdd6271be53d1410d (diff) | |
download | gcc-e6d7b956dbae9a91e493e7426802c63ef2322e77.zip gcc-e6d7b956dbae9a91e493e7426802c63ef2322e77.tar.gz gcc-e6d7b956dbae9a91e493e7426802c63ef2322e77.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/mangle61.C | 28 |
4 files changed, 41 insertions, 1 deletions
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 <jakub@redhat.com> + + 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 <jason@redhat.com> 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 <jakub@redhat.com> + + PR c++/56237 + * g++.dg/abi/mangle61.C: New test. + 2013-02-07 Vladimir Makarov <vmakarov@redhat.com> 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" } } |