Commit c53f7a6a by Jim Stichnoth

Subzero: Translate the unreachable bitcode directly to ud2.

This removes ice_unreachable() from the Subzero runtime. The ice_unreachable() implementation is problematic since it makes a call to external function abort(), which leads to an undefined symbol error in the linker because abort() is internalized at link time. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/945953002
parent 9f42d8ca
......@@ -15,8 +15,6 @@
#include <stdint.h>
#include <stdlib.h>
void ice_unreachable(void) { abort(); }
uint32_t cvtftoui32(float value) { return (uint32_t)value; }
uint32_t cvtdtoui32(double value) { return (uint32_t)value; }
......
......@@ -4119,10 +4119,7 @@ TargetX8632::eliminateNextVectorSextInstruction(Variable *SignExtendedResult) {
}
void TargetX8632::lowerUnreachable(const InstUnreachable * /*Inst*/) {
const SizeT MaxSrcs = 0;
Variable *Dest = nullptr;
InstCall *Call = makeHelperCall("ice_unreachable", Dest, MaxSrcs);
lowerCall(Call);
_ud2();
}
// Turn an i64 Phi instruction into a pair of i32 Phi instructions, to
......
......@@ -20,7 +20,7 @@ return: ; preds = %entry
; CHECK-LABEL: divide
; CHECK: cmp
; CHECK: call {{.*}} R_{{.*}} ice_unreachable
; CHECK: ud2
; CHECK: cdq
; CHECK: idiv
; CHECK: ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment