[erlang-patches] [erlang-bugs] bug (HiPE)

Björn-Egil Dahlberg egil@REDACTED
Mon Feb 25 17:21:43 CET 2013


On 2013-02-25 17:10, Kostis Sagonas wrote:
> On 02/25/2013 01:48 PM, Sebastian Egner wrote:
>> Hello,
>>
>> Consider the following module:
>>
>> ---- a.erl ----
>> -module(a).
>> -export([foo/1]).
>>
>> foo(X) when is_number(X) ->
>>      is_integer(X).
>> ----
>>
>> Then a:foo(0) evaluates to 'false' when compiled with HiPE:
>>
>> 1>  c(a).
>> 2>  a:foo(0).
>> true
>> 3>  hipe:c(a, []).
>> 4>  a:foo(0).
>> false      % *** WRONG ***
>>
>> The bug seems to be related to HiPE's icode type analysis:
>>
>> 5>  hipe:c(a, [no_icode_type]).
>> 6>  a:foo(0).
>> true
>>
>> For what it is worth, we have reproduced the problem on R14B04, 
>> R15B02, R15B03,
>> R16A and OTP_R16A_RELEASE_CANDIDATE-434-gc8651ed on Debian GNU/Linux
>> and for MacOSX (10.8.2).
>
> Thanks for bringing the bug into our attention. The two line fix for 
> it can be seen here:
>
>
> https://github.com/kostis/otp/commit/6907ed77452dcf409e0e3540cf7bd876e87b54b9 
>
>
>
> Although it's probably after the code freeze date, I sincerely hope 
> that this makes it into R16B because it fixes a real bug in the 
> integer range analysis of the native code compiler (and I cannot see 
> how it breaks anything else).

We will most probably include this patch. I've put Sverker on it. =)

// Björn-Egil

>
> Here is the command for adding this:
>
>   git fetch git://github.com/kostis/otp.git hipe-icode-range-bug
>
> Kostis
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
>




More information about the erlang-patches mailing list