authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-08-25 20:44:32-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-08-25 20:44:32-04:00
log6aa04c422bae89c50e1289e1ca51cd4d414debb7
tree0df59ea4ad5bbd2c89a2c6b672cb10f1d6e54eaa
parenta0223e513f69c6e23d08be7d4e408f345d074e5b

float division by zero check only when FloatMode.Optimzed

closes #395

1 files changed, 1 insertions(+), 1 deletions(-)

src/codegen.cpp+1-1
...@@ -1269,7 +1269,7 @@ static LLVMValueRef gen_div(CodeGen *g, bool want_debug_safety, bool want_fast_m...@@ -1269,7 +1269,7 @@ static LLVMValueRef gen_div(CodeGen *g, bool want_debug_safety, bool want_fast_m
1269 ZigLLVMSetFastMath(g->builder, want_fast_math);1269 ZigLLVMSetFastMath(g->builder, want_fast_math);
12701270
1271 LLVMValueRef zero = LLVMConstNull(type_entry->type_ref);1271 LLVMValueRef zero = LLVMConstNull(type_entry->type_ref);
1272 if (want_debug_safety) {1272 if (want_debug_safety && (want_fast_math || type_entry->id != TypeTableEntryIdFloat)) {
1273 LLVMValueRef is_zero_bit;1273 LLVMValueRef is_zero_bit;
1274 if (type_entry->id == TypeTableEntryIdInt) {1274 if (type_entry->id == TypeTableEntryIdInt) {
1275 is_zero_bit = LLVMBuildICmp(g->builder, LLVMIntEQ, val2, zero, "");1275 is_zero_bit = LLVMBuildICmp(g->builder, LLVMIntEQ, val2, zero, "");