From a14ee64402891d9c36e916ce17b01895b7ca2794 Mon Sep 17 00:00:00 2001 From: peadar Date: Sat, 27 Nov 2004 20:59:49 +0000 Subject: When required to negate the absoulte result of a division/remainder operation (by subtracting the absolute result from 0), don't test for overflow. This avoids an arithmetic exception when dividing LONG_MIN by 1: This is the only case that causes overflow, and the resulting value is correct under 2's compliment arithmetic. PR: 72024 Approved by: dwmalone@ Obtained from: NetBSD MFC after: 4 days --- lib/libc/alpha/gen/divrem.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libc/alpha/gen/divrem.m4 b/lib/libc/alpha/gen/divrem.m4 index 10406a6..6afa2e1 100644 --- a/lib/libc/alpha/gen/divrem.m4 +++ b/lib/libc/alpha/gen/divrem.m4 @@ -172,7 +172,7 @@ ifelse(OP, `div', ifelse(S, `true', ` /* Check to see if we should negate it. */ - subqv zero, RESULT, T_0 + subq zero, RESULT, T_0 cmovlbs NEG, T_0, RESULT ') -- cgit v1.1