On Thu, Aug 20, 2015 at 10:41:28AM -0600, Jeff Law wrote:
> On 08/20/2015 04:37 AM, Marek Polacek wrote:
> >On Thu, Aug 20, 2015 at 11:02:17AM +0200, Andreas Schwab wrote:
> >>Marek Polacek <pola...@redhat.com> writes:
> >>
> >>>   PR middle-end/67133
> >>>   * gimple-ssa-isolate-paths.c
> >>>   (insert_trap_and_remove_trailing_statements): Rename to ...
> >>>   (insert_trap): ... this.  Don't remove trailing statements; split
> >>>   block instead.
> >>>   (find_explicit_erroneous_behaviour): Don't remove all outgoing edges.
> >>
> >>This breaks go on aarch64:
> >>
> >>../../../libgo/go/encoding/gob/decode.go: In function 
> >>‘gob.decIgnoreOpFor.pN20_encoding_gob.Decoder’:
> >>../../../libgo/go/encoding/gob/decode.go:843:1: internal compiler error: in 
> >>operator[], at vec.h:714
> >>  func (dec *Decoder) decIgnoreOpFor(wireId typeId) decOp {
> >>  ^
> >>0xac5c3b vec<edge_def*, va_gc, vl_embed>::operator[](unsigned int)
> >>         ../../gcc/vec.h:714
> >>0xac5c3b extract_true_false_edges_from_block(basic_block_def*, edge_def**, 
> >>edge_def**)
> >>         ../../gcc/tree-cfg.c:8456
> >>0xace9bf gimple_verify_flow_info
> >>         ../../gcc/tree-cfg.c:5260
> >>0x6ea1ab verify_flow_info()
> >>         ../../gcc/cfghooks.c:260
> >>0xadeca3 cleanup_tree_cfg_noloop
> >>         ../../gcc/tree-cfgcleanup.c:739
> >>0xadeca3 cleanup_tree_cfg()
> >>         ../../gcc/tree-cfgcleanup.c:788
> >>0x9d21c3 execute_function_todo
> >>         ../../gcc/passes.c:1900
> >>0x9d2b07 execute_todo
> >>         ../../gcc/passes.c:2005
> >
> >Whilst I'm struggling with building cross libgo to reproduce this, is
> >there something like preprocessed source for go?  So that ideally I'd
> >just run ./go1 foo.go?  That'd help tremendously.
> The process for finding out what Go's doing is, umm, exceedingly difficult.
> Though at least for gcc-go, using "-v" will help.
 
Yeah :/.  I resorted to adding debug_function (cfun->decl, 0) and also some
debug_bb_n () to see how the cfg looks like...

But at least I have reproduced the ICE.

> RTH might have some ideas.
> 
> 
> Based on the error, I suspect we've got a block ending with a GIMPLE_COND
> with no successors in the CFG.

Except that I'm also seeing a different error:
/home/brq/mpolacek/gcc/libgo/go/text/template/exec.go:303:1: error: wrong
outgoing edge flags at end of bb 6
We have this bb:

<bb 6>:
# iftmp.1693_53 = PHI <0B(4)>
_54 = t_5(D)->Pipe;
GOTMP.163 = template.evalPipeline.pN19_text_template.state (s_7(D), dot, _31);
[return slot optimization]
dot = GOTMP.163;
_61 = __go_new (&__go_tdn_text_template..text_template.state, 64);
*_35 = *s_7(D);
# DEBUG newState => _35
_35->tmpl = iftmp.1693_55;
GOTMP.166.value = dot;
_66 = __go_new (&__go_td_AN22_text_template.variable1e, 40);
SR.4170_67 = "$";
SR.4171_68 = 1;
MEM[(struct .text/template.variable *)&GOTMP.166] = "$";
MEM[(struct .text/template.variable *)&GOTMP.166 + 8B] = 1;
MEM[(struct .text/template.variable[1] *)_40][0] = GOTMP.166;
_35->vars.__values = _40;
_35->vars.__count = 1;
_35->vars.__capacity = 1;
_75 ={v} iftmp.1693_55->Tree;
__builtin_trap ();
_76 = _46->Root;
D.8248.__methods =
&__go_pimt__I25_.text_template_parse.treeFrpN24_text_template_parse.Treeee4_CopyFrN24_text_template_parse.Nodeee8_PositionFrN23_text_template_parse.Posee6_StringFrN6_stringee4_TypeFrN28_text_template_parse.NodeTypeeee__N28_text_template_parse.ListNode;
D.8248.__object = _47;
template.walk.pN19_text_template.state (_35, dot, D.8248);
return;

and single_succ_p (bb) is not satisfied, so it must have more outgoing edges.
Not sure how can that happen...

Looking more.

        Marek

Reply via email to