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: unassig...@gcc.gnu.org
        ReportedBy: benjamin.poir...@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.

Reply via email to