On Fri, 2016-10-07 at 15:58 +0200, Bernd Schmidt wrote: > On 10/07/2016 03:26 PM, David Malcolm wrote: > > > > We could simply print the INSN_UID for CODE_LABELs; something like > > this > > (see the "(code_label 16" below): > > I think that should work. > > > You appear to have trimmed the idea of enclosing the insns with > > (basic-block) directives without commenting on it. Did you like > > this > > idea? > > Sorry - I appear to have completely missed it. > > > It would make the above look like: > > > > (basic-block 2 > > ;; insns snipped > > (jump_insn (set (pc) > > (if_then_else (ge (reg:CCGC 17 flags) > > (const_int 0 [0])) > > (label_ref 16) > > (pc))) "test.c":3 > > -> 16) > > ) ;; basic-block 2 > > (basic-block 4 > > (note [bb 4] NOTE_INSN_BASIC_BLOCK) > > ;; insns snipped > > (jump_insn (set (pc) (label_ref 20)) "test.c":4 > > -> 20) > > ) ;; basic-block 4 > > (barrier) > > (basic-block 5 > > (code_label 16 [1 uses]) > > (note [bb 5] NOTE_INSN_BASIC_BLOCK) > > ;; etc > > ) ;; basic-block 5 > > > > Note how the above format expresses clearly that: > > * the (barrier) is part of the insn chain, but not in a basic > > block, and > > * some insns can happen in a basic block > > That looks really nice IMO. Except maybe drop the "-> 16" bit for the > jump_insn (that's the JUMP_LABEL, isn't it?)
In r241120 I dropped all dumping of the JUMP_LABEL when adding the "compact" mode. I'm now running into an issue with this as I update the __RTL in cc1 tests to use the new format, since various passes require the JUMP_INSNs to have JUMP_LABEL data. For reference the JUMP_LABEL is at idx 7 of JUMP_INSN, a code '0' field, it's dumped by a special-case in print-rtx.c:print_rtx_operand_code_0, around line 186: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/print-rtl.c;hb=HEAD#l186 OK if I simply reinstate the existing dump form for that in compact mode, or would you prefer a different syntax? Maybe even just lose the newline in compact mode, giving something like the following: Example of a jump with JUMP_LABEL == a LABEL_REF. (cjump_insn (set (pc) (if_then_else (ge (reg:CCGC flags) (const_int 0)) (label_ref 16) (pc))) (nil) -> 16) Example of a jump with JUMP_LABEL == the simple_return_rtx singleton. (cjump_insn (set (pc) (label_ref 3)) (nil) -> simple_return) [...snip...] Dave