-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
The semantics provided for the SDIV instruction trigger undefined behaviour on INT_MIN / -1.
For example, 010cc19a sdiv x1, x0, x1 gives us something like:
%4 = load i64, ptr %X0, align 8
%5 = load i64, ptr %X1, align 8
// ....
%div.i.i = sdiv i64 %4, %5Since this overflows a 64-bit int, LLVM semantics specify it is UB.
However, the ARM reference does not raise an exception in such a case; it simply evaluates to INT_MIN.
Metadata
Metadata
Assignees
Labels
No labels