public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108449] [13 Regression] ICE in eliminate_unnecessary_stmts, at tree-ssa-dce.cc:1512
Date: Thu, 19 Jan 2023 07:43:10 +0000	[thread overview]
Message-ID: <bug-108449-4-qB1tyfZAZ5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108449-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so early we still have vfork() 'static' and maybe_special_function_p
returns false.  But then check_global_declaration () comes along and does

  /* Warn about any function declared static but not defined.  We don't
     warn about variables, because many programs have static variables
     that exist only to get some text into the object file.  */
  if (TREE_CODE (decl) == FUNCTION_DECL
      && DECL_INITIAL (decl) == 0
      && DECL_EXTERNAL (decl)
      && ! DECL_ARTIFICIAL (decl)
      && ! TREE_PUBLIC (decl))
    {
      if (warning_suppressed_p (decl, OPT_Wunused))
        ;
      else if (snode->referred_to_p (/*include_self=*/false))
        pedwarn (input_location, 0, "%q+F used but never defined", decl);
      else
        warning (OPT_Wunused_function, "%q+F declared %<static%> but never "
                                       "defined", decl);
      /* This symbol is effectively an "extern" declaration now.  */
      TREE_PUBLIC (decl) = 1;

which will result in maybe_special_function_p to return true.

I suppose leaving the decl static might have an effect on the linker errors
emitted for targets that require special asm ops for undefined external
references, but then you should still get an error here.

This mangling dates back to RMS at r0-3845-g7d429c41c5953f

  parent reply	other threads:[~2023-01-19  7:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 18:22 [Bug c/108449] New: " gscfq@t-online.de
2023-01-18 19:14 ` [Bug tree-optimization/108449] " pinskia at gcc dot gnu.org
2023-01-19  7:43 ` rguenth at gcc dot gnu.org [this message]
2023-01-19  7:46 ` rguenth at gcc dot gnu.org
2023-01-23  7:27 ` cvs-commit at gcc dot gnu.org
2023-01-23  7:28 ` rguenth at gcc dot gnu.org
2023-01-25  9:20 ` marxin at gcc dot gnu.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=bug-108449-4-qB1tyfZAZ5@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).