From bac7c55f9a9250f6edb57170530d567df6c92f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Fri, 20 Nov 2015 14:39:48 +0100 Subject: hipe: Allow unsigned args in hipe_rtl_arith hipe_rtl_arith is only used by hipe_rtl_ssa_const_prop, which applies it to any RTL, including RTL where the intent is to do unsigned math. Since signed and unsigned operations produce the same 2's complement result, this change is harmless. On 32-bit architectures it caused HiPE crashes when compiling code like <<0:((1 bsl 32)-1)>>, because the size of the field is too large to fit in a signed integer. --- lib/hipe/rtl/hipe_rtl_arith_32.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/hipe/rtl/hipe_rtl_arith_32.erl') diff --git a/lib/hipe/rtl/hipe_rtl_arith_32.erl b/lib/hipe/rtl/hipe_rtl_arith_32.erl index 572556be1c..d790a8b981 100644 --- a/lib/hipe/rtl/hipe_rtl_arith_32.erl +++ b/lib/hipe/rtl/hipe_rtl_arith_32.erl @@ -24,7 +24,8 @@ %% Filename : hipe_rtl_arith_32.erl %% Module : hipe_rtl_arith_32 %% Purpose : To implement 32-bit RTL-arithmetic -%% Notes : The arithmetic works on 32-bit signed integers. +%% Notes : The arithmetic works on 32-bit signed and unsigned +%% integers. %% The implementation is taken from the implementation %% of arithmetic on SPARC. %% XXX: This code is seldom used, and hence also -- cgit v1.2.3