[erlang-bugs] bug (HiPE)
Kostis Sagonas
kostis@REDACTED
Mon Feb 25 17:10:57 CET 2013
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).
Here is the command for adding this:
git fetch git://github.com/kostis/otp.git hipe-icode-range-bug
Kostis
More information about the erlang-bugs
mailing list