public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Visda.vokhshoori at microchip dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/98922] -fstack-usage not working with -flto
Date: Thu, 04 Feb 2021 14:42:10 +0000	[thread overview]
Message-ID: <bug-98922-4-o4UCfSghfs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98922-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Visda <Visda.vokhshoori at microchip dot com> ---
I looked at GCC 11 release notes, and found the fix
https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546494.html
Please correct me if I am wrong.

Given where we are in our release cycle, we decided to postpone pulling in this
patch.  For now, I fixed this in our local branch.  

We will get the new behaviour when we move up to GCC 11+.

Thanks.

FYI:
My local fix is:
diff --git a/gcc/toplev.c b/gcc/toplev.c
index bdf021e828a..e476c109cb4 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1050,7 +1050,10 @@ open_auxiliary_file (const char *ext)
   char *filename;
   FILE *file;

-  filename = concat (aux_base_name, ".", ext, NULL);
+#ifdef _BUILD_AVR3
+  if (strcmp (ext, "su") == 0 && flag_stack_usage)
+    filename = concat (lbasename(aux_base_name), ".", ext, NULL);
+  else
+#endif
+    filename = concat (aux_base_name, ".", ext, NULL);
   file = fopen (filename, "w");
   if (!file)
     fatal_error (input_location, "can%'t open %s for writing: %m", filename);
@@ -1898,7 +1901,7 @@ lang_dependent_init (const char *name)
       init_asm_output (name);

       /* If stack usage information is desired, open the output file.  */
-      if (flag_stack_usage)
+      if (flag_stack_usage 
+#ifdef _BUILD_AVR3
           && !flag_generate_lto
+#endif)
        stack_usage_file = open_auxiliary_file ("su");
     }

      parent reply	other threads:[~2021-02-04 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 17:08 [Bug lto/98922] New: " Visda.vokhshoori at microchip dot com
2021-02-02  8:20 ` [Bug lto/98922] " rguenth at gcc dot gnu.org
2021-02-02 13:11 ` marxin at gcc dot gnu.org
2021-02-04 14:42 ` Visda.vokhshoori at microchip dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98922-4-o4UCfSghfs@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).