Beware of GNU-ARM compiler for Cortex-M0/M0+/M1

Oct 10, 2017 21 Replies

No, that only limits the compiler's ability to re-order data reads and writes to memory - it does not affect statements or executable code except indirectly (if code is needed to calculate a value that is written before the memory clobber, then of course that code needs to run before the clobber statement). See the URL I gave a couple of lines down for an example where even asm volatile("" ::: "memory") does not help.

he

se

en

is

many

ead here

? I

little

e

o you.

ed

en

nd

y

od

d

p.

to

; \

o

am

Well that makes sense. I'm pretty sure I only use this clobber macro for me m rd/wr barriers so I think I'm okay but still, good to know. Thanks.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required