[erlang-bugs] internal error in native_compile

Mikael Pettersson mikpe@REDACTED
Fri Jul 23 12:58:59 CEST 2010


Paul Guyot writes:
 > Hello,
 > 
 > I am experiencing a strange error when compiling with +native the following module:
 > 
 > ----------------------------
 > -module(hipe_crash).
 > -export([f/6]).
 > 
 > f(A, B, C, D, E, L) ->
 >     lists:foldl(fun (X, P) ->
 >         AVar = case A of
 >             0 -> 1 / D;
 >             N -> N / (C - B)
 >         end,
 >         BVar = case E of
 >             atom1 -> 1.0;
 >             atom2 -> 0.8;
 >             _ -> E
 >         end,
 >         CVar = case X of
 >             atom1 -> 0.1 * AVar;
 >             _ -> 1.0
 >         end,
 >         P * BVar * CVar
 >     end, 1, L).
 > ----------------------------
 > 
 > I couldn't restrict the code further. For example, the error does not happen without the atom2 case line for BVar.
 > 
 > With +native, I get:
 > 
 > =ERROR REPORT==== 22-Jul-2010::18:17:53 ===
 > <HiPE (v 3.7.6)> Error: [hipe:867]: ERROR: {function_clause,
 >                                             [{proplists,get_bool,2},
 >                                              {global_group,
 >                                               global_groups_removed,1}]}
 > 
 > =ERROR REPORT==== 22-Jul-2010::18:17:53 ===
 > Error in process <0.30.0> with exit value: {{hipe,868,{function_clause,[{proplists,get_bool,2},{global_group,global_groups_removed,1}]}},[{hipe,finalize_fun_sequential,3},{hipe,'-finalize_fun_concurrent/3-fun-3-',4}]}
 > 
 > /Junk/tmp/hipe_crash.erl:none: internal error in native_compile;
 > crash reason: {{hipe,868,
 >                    {function_clause,
 >                        [{proplists,get_bool,2},
 >                         {global_group,global_groups_removed,1}]}},
 >                [{hipe,finalize_fun_sequential,3},
 >                 {hipe,'-finalize_fun_concurrent/3-fun-3-',4}]}
 > 
 > With +native +'{hipe, [verbose]}', I get:
 > 
 > <HiPE (v 3.7.6)> EXITED with reason {function_clause,[{hipe_icode_fp,assert_assigned,[[{30,{icode_variable,40,fvar,[]}}]]},{hipe_icode_fp,bindings_are_assigned,1},{hipe_icode_fp,filter_map,3},{hipe_icode_fp,transform_block,2},{hipe_icode_fp,cfg,1},{hipe_main,icode_ssa_type,4},{hipe_main,icode_ssa,4},{hipe_main,compile_icode,5}]} @hipe:868
 > 
 > =ERROR REPORT==== 22-Jul-2010::18:17:13 ===
 > <HiPE (v 3.7.6)> Error: [hipe:867]: ERROR: {function_clause,
 >                                             [{hipe_icode_fp,assert_assigned,
 >                                               [[{30,
 >                                                  {icode_variable,40,fvar,
 >                                                   []}}]]},
 >                                              {hipe_icode_fp,
 >                                               bindings_are_assigned,1},
 >                                              {hipe_icode_fp,filter_map,3},
 >                                              {hipe_icode_fp,transform_block,2},
 >                                              {hipe_icode_fp,cfg,1},
 >                                              {hipe_main,icode_ssa_type,4},
 >                                              {hipe_main,icode_ssa,4},
 >                                              {hipe_main,compile_icode,5}]}
 > /Junk/tmp/hipe_crash.erl:none: internal error in native_compile;
 > crash reason: {{hipe,868,
 >                    {function_clause,
 >                        [{hipe_icode_fp,assert_assigned,
 >                             [[{30,{icode_variable,40,fvar,[]}}]]},
 >                         {hipe_icode_fp,bindings_are_assigned,1},
 >                         {hipe_icode_fp,filter_map,3},
 >                         {hipe_icode_fp,transform_block,2},
 >                         {hipe_icode_fp,cfg,1},
 >                         {hipe_main,icode_ssa_type,4},
 >                         {hipe_main,icode_ssa,4},
 >                         {hipe_main,compile_icode,5}]}},
 >                [{hipe,finalize_fun_sequential,3},
 >                 {hipe,'-finalize_fun_concurrent/3-fun-3-',4}]}
 > 
 > This is with an R14A OTP installation configured with --enable-native-libs.
 > 
 > Any idea?

Confirmed.  You don't need --enable-native-libs, an R14A built without
that option fails in the same way.

You can work around it by adding the HiPE option no_inline_fp.

/Mikael


More information about the erlang-bugs mailing list