public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/15345] [3.4 Regression] [non-unit-at-a-time] unreferenced nested inline functions not optimized away
Date: Mon, 19 Jul 2004 14:11:00 -0000	[thread overview]
Message-ID: <20040719141153.3481.qmail@sourceware.org> (raw)
In-Reply-To: <20040509172606.15345.dank@kegel.com>


------- Additional Comments From jakub at gcc dot gnu dot org  2004-07-19 14:11 -------
This bug is IMHO very severe, it makes GCC 3.4.x totally unusable for glibc
builds as it almost doubles the size of the dynamic linker.
Can't this decision be reconsidered?

It worked just fine until GCC 3.3.x because of the DECL_DEFER_OUTPUT setting
in rest_of_compilation (now rest_of_handle_inlining).

I have played with:
--- gcc/toplev.c.jj        2004-02-20 19:37:45.000000000 +0100
+++ gcc/toplev.c    2004-07-19 15:50:30.985366840 +0200
@@ -2714,9 +2714,13 @@ rest_of_handle_inlining (tree decl)
             for unreferenced symbols.  See g77.f-torture/execute/980520-1.f.
             But removing this line from the check breaks all languages that
             use the call graph to output symbols.  This hard-coded check is
-            the least invasive work-around.  */
+            the least invasive work-around.
+            C nested functions need to be deferred here too, otherwise
+            they will be emitted even when never used.  */
          && (flag_inline_functions
-             || strcmp (lang_hooks.name, "GNU F77") == 0)
+             || strcmp (lang_hooks.name, "GNU F77") == 0
+             || (strcmp (lang_hooks.name, "GNU C") == 0
+                 && DECL_CONTEXT (decl)))
          && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
               && ! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
               && ! flag_keep_inline_functions)

Honza, can you see what problems could this cause?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15345


  parent reply	other threads:[~2004-07-19 14:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-09 17:26 [Bug optimization/15345] New: " dank at kegel dot com
2004-05-09 18:59 ` [Bug optimization/15345] [3.4/3.5 Regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-06-12 22:05 ` [Bug middle-end/15345] [3.4 " mmitchel at gcc dot gnu dot org
2004-06-13 14:13 ` jh at suse dot cz
2004-06-21 17:47 ` hubicka at gcc dot gnu dot org
2004-06-21 21:22 ` mmitchel at gcc dot gnu dot org
2004-07-02 20:47 ` pinskia at gcc dot gnu dot org
2004-07-09 16:48 ` pinskia at gcc dot gnu dot org
2004-07-19 14:11 ` jakub at gcc dot gnu dot org [this message]
2004-07-19 15:44 ` jh at suse dot cz
2004-07-21  7:37 ` cvs-commit at gcc dot gnu dot org
2004-07-21  7:39 ` cvs-commit at gcc dot gnu dot org
2004-07-21 17:54 ` pinskia at gcc dot gnu dot org

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=20040719141153.3481.qmail@sourceware.org \
    --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).