re PR c++/52247 (ICE with asm goto)
PR c++/52247 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call lookup_label on label's name and set TREE_USED. * g++.dg/template/asmgoto1.C: New test. From-SVN: r184229
This commit is contained in:
parent
72824d5e40
commit
61c8513078
4 changed files with 40 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2012-02-14 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/52247
|
||||
* pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
|
||||
lookup_label on label's name and set TREE_USED.
|
||||
|
||||
2012-02-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/39055
|
||||
|
|
13
gcc/cp/pt.c
13
gcc/cp/pt.c
|
@ -12612,8 +12612,17 @@ tsubst_copy_asm_operands (tree t, tree args, tsubst_flags_t complain,
|
|||
if (purpose)
|
||||
purpose = RECUR (purpose);
|
||||
value = TREE_VALUE (t);
|
||||
if (value && TREE_CODE (value) != LABEL_DECL)
|
||||
value = RECUR (value);
|
||||
if (value)
|
||||
{
|
||||
if (TREE_CODE (value) != LABEL_DECL)
|
||||
value = RECUR (value);
|
||||
else
|
||||
{
|
||||
value = lookup_label (DECL_NAME (value));
|
||||
gcc_assert (TREE_CODE (value) == LABEL_DECL);
|
||||
TREE_USED (value) = 1;
|
||||
}
|
||||
}
|
||||
chain = TREE_CHAIN (t);
|
||||
if (chain && chain != void_type_node)
|
||||
chain = RECUR (chain);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2012-02-14 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/52247
|
||||
* g++.dg/template/asmgoto1.C: New test.
|
||||
|
||||
2012-02-14 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
PR go/48501
|
||||
|
|
18
gcc/testsuite/g++.dg/template/asmgoto1.C
Normal file
18
gcc/testsuite/g++.dg/template/asmgoto1.C
Normal file
|
@ -0,0 +1,18 @@
|
|||
// PR c++/52247
|
||||
// { dg-do compile }
|
||||
|
||||
template <int N>
|
||||
bool
|
||||
bar ()
|
||||
{
|
||||
__asm goto ("" : : : : lab);
|
||||
return true;
|
||||
lab:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
foo ()
|
||||
{
|
||||
return bar<0> ();
|
||||
}
|
Loading…
Add table
Reference in a new issue