Joe Buehler <aspam@xxxxxxx> writes: > I am attempting to use inline assembly to implement a tracing mechanism that > results in code something like this (asm syntax not meant to be exact): > > "pre" C code... > > /* via inline asm */ > j trace > .pushsubsection 1000 > trace: > > "trace" C code... > > /* via inline asm */ > j post > .popsubsection > post: > > "post" C code... > > The idea is that the trace code can be nullified by changing the "j trace" > instruction to a NOP or activated by putting the jump back. I don't see how this can work reliably in gcc when optimizing. gcc freely rearranges blocks, and there is no way to prevent that. If there are any blocks between "trace" and "post", they may get moved out of the subsection. It's even possible that other blocks will get moved into the subsection. Ian