#variable does not increments when program compiled in release mode

1 messages · Page 1 of 1 (latest)

fading kelp
#

I've made a simple goto simulation, but variables does not increments when program built in release mode.
Why does this happens and how can i struggle with it?

P.S. It's works when value placed in global scope, but why it's doesn't working when value are in fn main scope?

rotund night
#

inline assembly doesnt retain what i guess you could call congruence across multiple instances of it. this means that LLVM will literally just insert the inline assembly without thinking about what it does.
this also means that you cannot create well-defined control flow between multiple inline assembly instructions.
in the global scope it only works because something else could have incremented value, so it cannot memoize it.