* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184229
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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);
+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
--- /dev/null
+// PR c++/52247
+// { dg-do compile }
+
+template <int N>
+bool
+bar ()
+{
+ __asm goto ("" : : : : lab);
+ return true;
+lab:
+ return false;
+}
+
+bool
+foo ()
+{
+ return bar<0> ();
+}