mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 17:16:08 -06:00
Following the review in https://github.com/compiler-explorer/compiler-explorer/pull/8826/changes/c4d8590f6a992b4478f9f08b41af2ac05bff3402#r3476267780, this PR tries to clean up file/line info from gcc dumps. Example `expand (rtl)` output, for the default C++ source example: ``` ;; Function square (_Z6squarei, funcdef_no=0, decl_uid=2861, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 ;; Generating RTL for gimple basic block 3 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. Removing jump 11. Merging block 5 into block 2... Merged blocks 2 and 5. Merged 2 and 5 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 4 NOTE_INSN_DELETED) (note 4 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 2 4 3 2 (set (mem/c:SI (plus:DI (reg/f:DI 93 virtual-stack-vars) (const_int -4 [0xfffffffffffffffc])) [1 num+0 S4 A32]) (reg:SI 5 di [ num ])) :2:21 -1 (nil)) (note 3 2 6 2 NOTE_INSN_FUNCTION_BEG) (insn 6 3 7 2 (set (reg:SI 100) (mem/c:SI (plus:DI (reg/f:DI 93 virtual-stack-vars) (const_int -4 [0xfffffffffffffffc])) [1 num+0 S4 A32])) :3:18 -1 (nil)) (insn 7 6 10 2 (parallel [ (set (reg:SI 98 [ _2 ]) (mult:SI (reg:SI 100) (reg:SI 100))) (clobber (reg:CC 17 flags)) ]) :3:18 -1 (nil)) (insn 10 7 14 2 (set (reg:SI 99 [ <retval> ]) (reg:SI 98 [ _2 ])) :3:18 discrim 1 -1 (nil)) (insn 14 10 15 2 (set (reg/i:SI 0 ax) (reg:SI 99 [ <retval> ])) :4:1 -1 (nil)) (insn 15 14 0 2 (use (reg/i:SI 0 ax)) :4:1 -1 (nil)) ``` --------- Co-authored-by: Ofek Shilon <oshilon@speedata.io> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>