How to tell the GCC compiler that code should be generated serial, i.e., without jumps.
I'm working on a project that embeds inline assembly into a C source code (or LLVM IR).
My implementation depends on code between the inline assembly to be written into the executable as-is.
More formally, suppose I have the soure code (C or LLVM IR):
.label_start: (inserted as inline assembly)
inline_assembly0
source_code0
source_code1
inline_assembly1
...
.label_end: (inserted as inline assembly)
...
Now, this should not be compiled as:
.jmp_target:
source_code1
inline_assembly1
...
.label_end: (inserted as inline assembly)
...
.label_start: (inserted as inline assembly)
inline_assembly0
source_code0
jmp jmp_target
I.e. code should stay between labels without jumps reordering .label_start
and .label_end
.
Is there any way of telling GCC that everything between two inline assembly labels should stay "intact" without being reordered? My implementation depends on this.