I am attempting to access the x86_64 DIV instruction from inline assembly as follows: inline void div128(uint64_t* q, uint64_t *r, uint64_t n1, uint64_t n0, uint64_t d) { __asm__("divq %4" : "=a" (*q), "=d" (*r) : "1" (n1), "0" (n0), "rm" (d) : "cc"); } I declare input and output operands, but is that sufficient? The DIV instruction can produce a divide error for certain inputs. The GCC documentation says that inline assembly may be discarded or moved out of loops. Can it also be speculatively executed? I have a case in GCC 11.2 where a single DIV is duplicated and executed on two different inputs coming from two sides of a conditional. One of the inputs (the one not chosen by the conditional) produces a divide error. Is my code at fault? Do I need the volatile qualifier? Or is GCC not supposed to speculatively execute inline assembly? Here is a reproducible case: https://godbolt.org/z/37z3foTff