On Mon, 13 Jan 2025, Jakub Jelinek wrote: > Hi! > > Something I've noticed during working on the crc wrong-code fix. > My first version of the patch failed because of no longer matching some > expected strings in the assembly, so I had to add TDF_DETAILS debugging > into the -fdump-rtl-expand-details dump which the crc tests can use. > > For PR115910 Andrew has added similar note for the division/modulo case > if it is positive and we can choose either unsigned or signed > division. The problem is that unlike most other TDF_DETAILS diagnostics, > this is not done before emitting the IL for the function, but during it. > > Other messages there are prefixed with ;;, both details on what it is doing > and the GIMPLE IL for which it expands RTL, so the > ;; Generating RTL for gimple basic block 4 > > ;; > > (code_label 13 12 14 2 (nil) [0 uses]) > > (note 14 13 0 NOTE_INSN_BASIC_BLOCK) > positive division: unsigned cost: 30; signed cost: 28 > > ;; return _4; > > message in between just looks weird and IMHO should be ;; prefixed. > > The following patch does that, ok for trunk?
OK. > 2025-01-13 Jakub Jelinek <ja...@redhat.com> > > PR target/115910 > * expr.cc (expand_expr_divmod): Prefix the TDF_DETAILS note with > ";; " and add a space before (needed tie breaker). Formatting fixes. > > --- gcc/expr.cc.jj 2025-01-13 09:12:08.589966845 +0100 > +++ gcc/expr.cc 2025-01-13 11:21:11.501285143 +0100 > @@ -9710,9 +9710,9 @@ expand_expr_divmod (tree_code code, mach > } > > if (dump_file && (dump_flags & TDF_DETAILS)) > - fprintf(dump_file, "positive division:%s unsigned cost: %u; " > - "signed cost: %u\n", was_tie ? "(needed tie breaker)" : "", > - uns_cost, sgn_cost); > + fprintf (dump_file, ";; positive division:%s unsigned cost: %u; " > + "signed cost: %u\n", > + was_tie ? " (needed tie breaker)" : "", uns_cost, sgn_cost); > > if (uns_cost < sgn_cost || (uns_cost == sgn_cost && unsignedp)) > { > > Jakub > > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)