From b90f66ba9d0f2ae2ab7a2ac56e3113d6caa2faad Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 12 Nov 2014 23:01:24 +0000 Subject: PR21518: Use unsigned arithmetic for trapping add/sub functions. The code in {add,sub}v.i3 routines does not trap when it should, because it performs the actual add/subtract operation in signed arithmetic, rather than unsigned. Patch by Francois-Xavie Coudert! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221826 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/builtins/addvti3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/builtins/addvti3.c') diff --git a/lib/builtins/addvti3.c b/lib/builtins/addvti3.c index 79b9611f9..c224de60a 100644 --- a/lib/builtins/addvti3.c +++ b/lib/builtins/addvti3.c @@ -23,7 +23,7 @@ COMPILER_RT_ABI ti_int __addvti3(ti_int a, ti_int b) { - ti_int s = a + b; + ti_int s = (tu_int) a + (tu_int) b; if (b >= 0) { if (s < a) -- cgit v1.2.3