]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Restore original format of -fstack-usage and add new second field
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 25 May 2026 07:42:04 +0000 (09:42 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 25 May 2026 07:42:04 +0000 (09:42 +0200)
This should minimize the backward compatibility breakage.

gcc/
* doc/invoke.texi (fstack-usage): Document new second field.
* toplev.cc (output_stack_usage_1): Revert latest changes and add
the mangled name as the second field.

gcc/testsuite/
* gcc.dg/stack-usage-1.c: Adjust.

gcc/doc/invoke.texi
gcc/testsuite/gcc.dg/stack-usage-1.c
gcc/toplev.cc

index 8bfa73598c2fc1eb7b0c20d2ccd8d5506f84b2e0..b605defb39076f78fd2137f16e114375feb8d878 100644 (file)
@@ -21095,15 +21095,17 @@ per-function basis.  The filename for the dump is made by appending
 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
 the output file, if explicitly specified and it is not an executable,
 otherwise it is the basename of the source file.  An entry is made up
-of three fields:
+of four fields separated by tabulation characters:
 
 @itemize
 @item
-The name of the function.
+The name of the function preceded by its source location
 @item
-A number of bytes.
+The mangled name of the function
 @item
-One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
+A number of bytes
+@item
+One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}
 @end itemize
 
 The qualifier @code{static} means that the function manipulates the stack
index 1ba9d059956b5b5fd3c926564c73015d3c0bbdde..f46e1cf983ca3cacc1e91a1ae81ab0921ad655ea 100644 (file)
@@ -116,5 +116,5 @@ int foo (void)
   return 0;
 }
 
-/* { dg-final { scan-stack-usage "foo `foo`\t\(256|264\)\tstatic" } } */
+/* { dg-final { scan-stack-usage "foo\tfoo\t\(256|264\)\tstatic" } } */
 /* { dg-final { cleanup-stack-usage } } */
index 7925462bc583b9a172c520b83749b656b0f27583..3d4319fa3286c2f3614df962347f39b7dab905ba 100644 (file)
@@ -840,12 +840,11 @@ output_stack_usage_1 (FILE *cf)
   if (stack_usage_file)
     {
       print_decl_identifier (stack_usage_file, current_function_decl,
-                            PRINT_DECL_ORIGIN | PRINT_DECL_UNIQUE_NAME
+                            PRINT_DECL_ORIGIN | PRINT_DECL_NAME
                             | PRINT_DECL_REMAP_DEBUG);
-      fprintf (stack_usage_file, " `");
+      fputs ("\t", stack_usage_file);
       print_decl_identifier (stack_usage_file, current_function_decl,
-                            PRINT_DECL_NAME);
-      fprintf (stack_usage_file, "`");
+                            PRINT_DECL_UNIQUE_NAME);
       fprintf (stack_usage_file, "\t" HOST_WIDE_INT_PRINT_DEC"\t%s\n",
               stack_usage, stack_usage_kind_str[stack_usage_kind]);
     }