https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90574
--- Comment #2 from Yibiao Yang <yangyibiao at nju dot edu.cn> --- (In reply to Richard Biener from comment #1) > We somehow build a broken(?) CFG from the start: > > ;; basic block 2, loop depth 0 > ;; pred: ENTRY > if (argc == 0) > ;; succ: 3 > > ;; basic block 3, loop depth 0 > ;; pred: 2 > label: > if (argc == 1) > goto <bb 4>; [INV] > else > goto <bb 5>; [INV] > > see how BB2 only has a single outgoing edge. CFG cleanup fixes this for us. > > .gimple has > > [t.c:2:1] { > void label = <<< error >>>; > > [t.c:3:6] if (argc == 0) goto <D.1912>; else goto <D.1913>; > <D.1912>: > [t.c:4:5] { > int * ptr; > > [t.c:6:1] label: > } > <D.1913>: > [t.c:10:6] if (argc == 1) goto <D.1914>; else goto <D.1915>; > > so that looks good, likewise .lower: > > [t.c:3:6] if (argc == 0) goto <D.1912>; else goto <D.1913>; > <D.1912>: > [t.c:6:1] label: > <D.1913>: > [t.c:10:6] if (argc == 1) goto <D.1914>; else goto <D.1915>; > > iff we'd elide an empty block as having no side-effects we would have > deleted the label. > > Thus confirmed as CFG build bug. Thanks for the comfirmation. Another bug I reported seems also a valid bug with a different code structure. I am not quite sure whether it is a valid or not. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90584