This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/49342] New: asm goto documentation error in code snippet
- From: "benjamin.poirier at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 12:59:58 +0000
- Subject: [Bug other/49342] New: asm goto documentation error in code snippet
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49342
Summary: asm goto documentation error in code snippet
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: benjamin.poirier@gmail.com
Created attachment 24473
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24473
patch that fixes said documentation error
in gcc/doc/extend.texi or http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
The third example for asm goto usage has a bug:
#define TRACE1(NUM) \
do { \
asm goto ("0: nop;" \
".pushsection trace_table;" \
".long 0b, %l0;" \
".popsection" \
: : : : trace#NUM); \
if (0) { trace#NUM: trace(); } \
} while (0)
#define TRACE TRACE1(__COUNTER__)
trace#NUM should be trace##NUM (in both places), we're trying to generate
unique label names. Compiling the example as-is fails.