This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/49342] New: asm goto documentation error in code snippet


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]