Part Number: F29H859TU-Q1
Hello,
I am using the C29 Clang compiler and I am searching for the best way to create a barrier in the code instructing the compiler to not mix the code before the barrier with the code after the barrier.
This feature can be useful for example to be able to measure the duration of some code (to guarantee that we are measuring what we want).
I heard about different solutions but I am not sure about their robustness:
-
__builtin_instrumentation_label()
- asm volatile ("")
- asm volatile ("" : : : "memory")
So could you please provide which solution we shoud use and want are the limitations of this solution on the current version of the compiler (2.2.0 LTS) but also what could be the limitations in the future (globally, what is guaranteed and what is not).
Thank you