Ayonam Ray <ayonam@xxxxxxxxx> writes: > I have a set of built-ins implemented using unspec_volatile which set > various processor control modes for rounding, overflow, etc. > Now what I see is that if I call these builtins in between the > arithmetic operations in C code, at -O1 and -O2, it puts together all > those calls to the built-ins at the top of the function body and sends > all the arithmetic operations below. Effectively, the arithmetic > operations do not conform to the processor modes that I am setting. > The same code works fine at -O0, i.e., the operations are not > reordered (as expected). Your RTL is not expressing the dependencies between these instructions. Using UNSPEC_VOLATILE doesn't prevent instructions from moving, it only pevents them from being deleted. The usual way to express this would be to have your process control insns set some fixed register and have your match insns refer to that fixed register. By set and refer I only mean in the RTL, not in the generated assembler code. Ian