https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98922
Bug ID: 98922 Summary: -fstack-usage not working with -flto Product: gcc Version: 8.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: Visda.vokhshoori at microchip dot com CC: marxin at gcc dot gnu.org Target Milestone: --- With link time optimization, -flto, the compiler doesn't print the stack usage information to auxname.su file. With -flto, the compiler dumps the stack usage of each function in sourcfile/auxname.ltrans0.ltrans.su file. However, maybe_unlink() in lto_wrapper.c removes all trans files, unless --save-temps is specified. To reproduce: You can modify "gcc.dg/stack-usage-1.c": test case source to call foo() in main(), and compile and link with flto and fstack-usage options, and scan for { dg-final { scan-stack-usage "foo\t\(0\)\tstatic" } } The scan will fail.