[erlang-questions] R12B-0 HiPE option no_remove_comments

Mikael Pettersson mikpe@REDACTED
Thu Dec 6 10:31:49 CET 2007


On Thu, 6 Dec 2007 02:38:13 +0100, Roger Larsson wrote:
> I have a script that can be used to look at hipe steps.
> 
> ----
> #!/bin/sh
> erlc +native +\{hipe,\[no_remove_comments,pp_all\]\} $1
> ---- fac.erl
> -module(fac).
> -export([fac/2]).
> 
> fac(A,0)->A;
> fac(A,N)->fac(A*N,N-1).
> ----
> 
> This does not work in R12B, it is the no_remove_comments fault.
> bash> ./get_icode.sh fac.erl
>   label 1:
>     {func_info,{atom,fac},{atom,fac},2}
>   label 2:
>     {test,is_eq_exact,{f,3},[{x,1},{integer,0}]}
>     return
>   label 3:
>     {gc_bif,'*',{f,0},2,[{x,0},{x,1}],{x,0}}
>     {gc_bif,'-',{f,0},2,[{x,1},{integer,1}],{x,1}}
>     {call_only,2,{fac,fac,2}}
> 
> fac:fac/2(v0, v5) ->
> %% Info:['Not a closure','Leaf function']
> 1:
>     _ := redtest() (primop)
>     if is_{integer,0}(v5) then 3 (0.50) else 6
> 3:
>     return(v0)
> 6:
>     v0 := '*'(v0, v5) (primop)
>     v8 := 1
>     v5 := '-'(v5, v8) (primop)
>     % self_tail_recursive
>     goto 1
> %% Data:
> <HiPE (v 3.6.4)> EXITED with reason {{case_clause,
> {comment,self_tail_recursive}},[{hipe_icode_range,analyse_insn,3},
> {hipe_icode_range,analyse_BB,5},{hipe_icode_range,analyse_block,4},
> {hipe_icode_range,analyse_blocks,3},{hipe_icode_range,analyse,2},
> {hipe_icode_range,do_analysis,3},{hipe_icode_range,concurrent_cfg,4},
> {hipe_main,icode_range_analysis,3}]} @hipe:907

We generally don't compile with no_remove_comments,
and it's entirely possible that some newer code fails
to ignore comments.

Thanks for reporting this issue. We'll look into it.

/Mikael
The HiPE group



More information about the erlang-questions mailing list