anchor.diff:  
   %% pat_alias(CorePat, CorePat) -> AliasPat.
   %%  Normalise aliases. This has been taken from v3_core.erl in the
  -%%  erlang compiler. Trap bad aliases by throwing 'nomatch'.
  -
  -pat_alias(#c_var{name=V1}, P2) -> #c_alias{var=#c_var{name=V1},pat=P2};
  -pat_alias(P1, #c_var{name=V2}) -> #c_alias{var=#c_var{name=V2},pat=P1};
  -pat_alias(#c_cons{}=Cons, #c_literal{anno=A,val=[H|T]}=S) ->
  -    pat_alias(Cons, #c_cons{anno=A,hd=#c_literal{anno=A,val=H},
  -                tl=S#c_literal{val=T}});
  -pat_alias(#c_literal{anno=A,val=[H|T]}=S, #c_cons{}=Cons) ->
  -    pat_alias(#c_cons{anno=A,hd=#c_literal{anno=A,val=H},
  -              tl=S#c_literal{val=T}}, Cons);
  -pat_alias(#c_cons{anno=A,hd=H1,tl=T1}, #c_cons{hd=H2,tl=T2}) ->
  -    #c_cons{anno=A,hd=pat_alias(H1, H2),tl=pat_alias(T1, T2)};
  -pat_alias(#c_tuple{es=Es1}, #c_tuple{es=Es2}) ->
  -    #c_tuple{es=pat_alias_list(Es1, Es2)};
  -pat_alias(#c_binary{segments=Segs1}=Bin, #c_binary{segments=Segs2}) ->
  -    Bin#c_binary{segments=pat_alias_list(Segs1, Segs2)};
  -pat_alias(#c_bitstr{val=P1,size=Sz,unit=U,type=T,flags=F}=Bitstr,
  -      #c_bitstr{val=P2,size=Sz,unit=U,type=T,flags=F}) ->
  -    Bitstr#c_bitstr{val=pat_alias(P1, P2)};
  -pat_alias(#c_alias{var=V1,pat=P1}, #c_alias{var=V2,pat=P2}) ->
  -    if V1 =:= V2 -> pat_alias(P1, P2);
  -       true -> #c_alias{var=V1,pat=#c_alias{var=V2,pat=pat_alias(P1, P2)}}
  -    end;
  -pat_alias(#c_alias{var=V1,pat=P1}, P2) ->
  -    #c_alias{var=V1,pat=pat_alias(P1, P2)};
  -pat_alias(P1, #c_alias{var=V2,pat=P2}) ->
  -    #c_alias{var=V2,pat=pat_alias(P1, P2)};
  -pat_alias(P1, P2) ->
  -    case {core_lib:set_anno(P1, []),core_lib:set_anno(P2, [])} of
  -    {P,P} -> P;                %Same pattern.
  -    _ -> throw(nomatch)
  +%%  erlang compiler. This is more complicated in core as we can
  +%%  sometimes get structures as "literal". Trap bad aliases by
  +%%  throwing 'nomatch' as these should have been caught in lfe_lint.
  +
  +pat_alias(Cp1, Cp2) ->
  +    %% io:format("pa: ~p\n", [{Cp1,Cp2}]),
  +    case {cerl:type(Cp1),cerl:type(Cp2)} of
  +        {var,_} -> c_alias(Cp1, Cp2);
  +        {_,var} -> c_alias(Cp2, Cp1);
  +        {cons,literal} ->
  +            pat_alias_cons(Cp1, Cp2);
  +        {literal,cons} ->
  +            pat_alias_cons(Cp2, Cp1);
  +        {cons,cons} ->
  +            c_cons(pat_alias(cons_hd(Cp1), cons_hd(Cp2)),
  +                   pat_alias(cons_tl(Cp1), cons_tl(Cp2)));
  +        {tuple,literal} ->
  +            pat_alias_tuple(Cp1, Cp2);
  +        {literal,tuple} ->
  +            pat_alias_tuple(Cp2, Cp1);
  +        {tuple,tuple} ->
  +            c_tuple(pat_alias_list(tuple_es(Cp1), tuple_es(Cp2)));
  +        {alias,alias} ->
  +            Cv1 = alias_var(Cp1),
  +            Cv2 = alias_var(Cp2),
  +            if Cv1 =:= Cv2 ->
  +                    pat_alias(alias_pat(Cp1), alias_pat(Cp2));
  +               true ->
  +                    c_alias(Cv1, c_alias(Cv2, pat_alias(alias_pat(Cp1),
  +                                                        alias_pat(Cp2))))
  +            end;
  +        {alias,_} ->
  +            c_alias(alias_var(Cp1), pat_alias(alias_pat(Cp1), Cp2));
  +        {_,alias} ->
  +            c_alias(alias_var(Cp2), pat_alias(Cp1, alias_pat(Cp2)));
  +        _ ->
  +            %% Check that they are the same except for annotation.
  +            case {set_ann(Cp1, []),set_ann(Cp2, [])} of
  +                {P,P} -> Cp1;
  +                _ -> throw({nomatch,Cp1,Cp2})
  +            end
       end.
   
  -%% pat_alias(Lp0, Rp0) ->
  -%%     case {cerl:type(Lp0),cerl:type(Rp0)} of
  -%%         {var,_} -> cerl:c_alias(Lp0, Rp0);
  -%%         {_,var} -> cerl:c_alias(Rp0, Lp0);
  -%%         {cons,literal} ->
  -%%             Ann = cerl:get_ann(Rp0),
  -%%             [H|T] = cerl:concrete(Rp0),
  -%%             pat_alias(Lp0, cerl:ann_c_cons(Ann, cerl:ann_abstract(Ann, H),
  -%%                                            cerl:ann_abstract(Ann, T)));
  -%%         {literal,cons}
  +pat_alias_cons(Cc, Cl) ->
  +    case lit_val(Cl) of
  +        [H|T] ->
  +            %% Must be sure to build a #c_cons{} here
  +            pat_alias(Cc, c_cons_skel(c_lit(H), c_lit(T)));
  +        _ -> throw(nomatch)
  +    end.
  +
  +pat_alias_tuple(Ct, Cl) ->
  +    case lit_val(Cl) of
  +        Tup when is_tuple(Tup) ->
  +            update_c_tuple(Ct, pat_alias_list(tuple_es(Ct), data_es(Cl)));
  +        _ -> throw(nomatch)
  +    end.
   
   %% pat_alias_list([A1], [A2]) -> [A].
   
  
positive.code:     {Cval,Csize,Un,Ty,Fs,St1} = comp_bitseg(Vsp, Env, L, St0),
      %% Sequentialise Val and Size if necessary, then do rest
      Next = fun ([Cv,Csz], En, Li, St) ->
                     Cs = c_bitseg(Cv, Csz, Un, Ty, Fs),
                     comp_bitsegs(Segs, [Cs|Csegs], En, Li, St)
             end,
      simple_seq([Cval,Csize], Next, Env, L, St1);
  comp_bitsegs([], Csegs, _, L, St) ->
      {c_binary([L], reverse(Csegs)),St}.
  
  %% comp_bitseg(ValSpec, Env, Line, State) -> {Cval,Csize,Unit,Type,Fs,State}.
  %% Need to handle some special cases.
  
negative.code:         false ->
              {Cv,St1} = new_c_var(L, St0),
              {Rest,St2} = simple_seq(Ces, Then, [Cv|Ses], Env, L, St1),
              {ann_c_let([L], [Cv], Ce, Rest),St2}
      end;
  simple_seq([], Then, Ses, Env, L, St) ->
      Then(reverse(Ses), Env, L, St).
  
  %% comp_lambda(Args, Body, Env, Line, State) -> {c_fun(),State}.
  %% Compile a (lambda (...) ...).
  
  comp_lambda(Args, Body, Env, L, St0) ->
      {Cvs,Pvs,St1} = comp_lambda_args(Args, L, St0),
      {Cb,St2} = comp_body(Body, add_vbindings(Pvs, Env), L, St1),
      Ann = line_file_anno(L, St2),
      {ann_c_fun(Ann, Cvs, Cb),St2}.
  
  comp_lambda_args(Args, L, St) ->
      foldr(fun (A, {Cvs,Pvs0,St0}) ->
  