https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119718

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, wonder if it wouldn't be more user-friendly to emit the GIMPLE or
GENERIC calls on the same line, incremental
--- gcc/tree-tailcall.cc.jj     2025-04-11 09:38:22.483257379 +0200
+++ gcc/tree-tailcall.cc        2025-04-11 10:12:06.419122909 +0200
@@ -494,8 +494,8 @@ maybe_error_musttail (gcall *call, const
     }
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
+      fprintf (dump_file, "Cannot tail-call: %s: ", err);
       print_gimple_stmt (dump_file, call, 0, TDF_SLIM);
-      fprintf (dump_file, "Cannot tail-call: %s\n", err);
     }
 }

--- gcc/calls.cc.jj     2025-04-11 10:02:22.000000000 +0200
+++ gcc/calls.cc        2025-04-11 10:12:44.555592826 +0200
@@ -1282,9 +1282,9 @@ maybe_complain_about_tail_call (tree cal
       && dump_file
       && (dump_flags & TDF_DETAILS))
     {
-      fprintf (dump_file, ";; ");
+      fprintf (dump_file, ";; Cannot tail-call: %s: ", reason);
       print_generic_expr (dump_file, call_expr, TDF_SLIM);
-      fprintf (dump_file, "\n;; Cannot tail-call: %s\n", reason);
+      fprintf (dump_file, "\n");
     }
 }

./xgcc -B ./ -S -O2 -fdump-{tree-tailc,rtl-expand}-details pr119718.c ; grep
'^\(;; \)\?Cannot tail-call:' pr119718.c.*
pr119718.c.222t.tailc:Cannot tail-call: call invocation refers to locals: _7 =
bar (0);
pr119718.c.270r.expand:;; Cannot tail-call: callee required more stack slots
than the caller: foo (1, 2, 3, 4, 5, 6, 7) [tail call]

Reply via email to