This is the mail archive of the gcc-patches@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]

Re: [RFC] asm goto



However, the usage case from the kernel folk doesn't actually need
outputs. They want to perform some code patching for (essentially) zero
cost tracing. Their use case looks vaguely like

+#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__)

What's the need for the "asm goto" syntax? The fourth colon should be enough.


Paolo


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