[erlang-bugs] Native compilation hangs with rm-reverse-eta-conversion

Björn Gustavsson <>
Mon Jan 21 12:00:10 CET 2013


You mean the boolan in `Escaping`?

I am not an expert on the hipe compiler, but I just had
a look at the code and I think I have some answers.

`Escaping` is  the functions that can be called from
outside the module (they presumably needs stubs).
The boolean seems to be `true` for funs and `false`
for exports.

But the boolean is not actually used!
hipe_icode_coordinator filters it away! (See
coordinate/4 and initialize_server/2.)

I have attached a crude fix that eliminates the
duplicate entry in `Escaping`. I have verified that
the compiler no long hangs, but I have not verified
anything else.




On Mon, Jan 21, 2013 at 10:09 AM, Anthony Ramine <> wrote:

> Hi Kostis,
>
> My patch removes the automatic eta-abstraction for function references
> from the BEAM code generation [1]. The consequence of this is that some fun
> references labels (the ones which are from exported functions) are now
> taken from the exports table in beam_dict.
>
> This makes hipe pass exported functions which are used as fun references
> to hipe_coordinator both in `Closures` and `Exported`, and that makes
> everything hang if the exported function contains a fun reference to
> itself, like in erl_syntax:is_literal/1 [3].
>
> Could you explain to me what `Escaping` and `NonEscaping` means? More
> specifically, what the boolean() value in the pairs of `NonEscaping` mean.
>
> Regards,
>
> [1] https://github.com/nox/otp/commit/42b87b
> [2] https://github.com/nox/otp/blob/master/lib/hipe/main/hipe.erl#L762-770
> [3]
> https://github.com/nox/otp/blob/master/lib/syntax_tools/src/erl_syntax.erl#L5909-5929
>
> --
> Anthony Ramine
>
> Le 20 janv. 2013 à 09:30, Kostis Sagonas a écrit :
>
> > The following is just a guess, but I suspect that your patch either
> broke a bytecode invariant that the hipe type analyzer relied on (in which
> case your code needs to respect this invariant), or generated code which is
> OK but it's code that had never been tested before (so it's a bug in the
> analysis of the native code compiler)
>
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
>



-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130121/c0b2f0b1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crude-fix.patch
Type: application/octet-stream
Size: 900 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130121/c0b2f0b1/attachment.obj>


More information about the erlang-bugs mailing list