public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/40831] g++ generated symbols for cloned function that be demangled.
Date: Wed, 23 Feb 2011 19:46:00 -0000	[thread overview]
Message-ID: <bug-40831-4-1o0df4SCpj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-40831-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> 2011-02-23 19:03:36 UTC ---
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831
> 
> --- Comment #9 from Cary Coutant <ccoutant at gcc dot gnu.org> 2011-02-23 18:30:19 UTC ---
> > Does not work for `_Z3fooi.1988' or
> > `_Z3fooi.part.9.165493.constprop.775.31805'.
> 
> Where does the _Z3fooi.1988 style come from?
We add the .1234 suffixes in LTO for local symbols (to avoid clashes in between
two static
variables of the same name).

As WHOPR progress, we might end up adding two numbered suffixes, because we
mangle at wpa time and then ship the mangled symbols to ltrans when we mangle
again.  Disabling the second mangling is trivial, but no one did it yet.  The
first mangling happens even when tere are no conflicts that is stupid, but in
case of conflicts it needs to happen.
> 
> I guess your second example is from a cloned function (due to partial inlining)
> that got cloned again (due to constant propagation), but why are there two
> numbers on each?
_Z3fooi.1988 is created from _Z3fooi by LTO mangling.

We also do precisely same mangling from function static variables, i.e.
test()
{
  static int a;
}

will get out a as a.1234

_Z3fooi becomes _Z3fooi.part.9 by partial inlining
.165493 is added at WPA time because function is static (all partial functions
are)
.constprop.775 is added because one of argument was proved to be constant by
cprop pass
.31805 comes from (completely redundant) name mangling at ltrans time. 

It is possible to change way we mangle the LTO vars, if neccesary for some good
reason.

Those numbered suffixes that do not come from function versioning (i.e. don't
have .part or .constprop) are redundant, so I guess they might be just silently
dropped?

Honza


  parent reply	other threads:[~2011-02-23 19:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
2011-01-05  1:07 ` d.g.gorbachev at gmail dot com
2011-01-06 14:45 ` hubicka at gcc dot gnu.org
2011-02-23  7:08 ` ccoutant at gcc dot gnu.org
2011-02-23  9:04 ` d.g.gorbachev at gmail dot com
2011-02-23 18:46 ` ccoutant at gcc dot gnu.org
2011-02-23 19:46 ` hubicka at ucw dot cz [this message]
2011-08-20  3:35 ` ccoutant at gcc dot gnu.org
2011-09-23 21:47 ` ccoutant at gcc dot gnu.org
2011-09-24 12:35 ` d.g.gorbachev at gmail dot com
2011-09-26 18:32 ` ccoutant at gcc dot gnu.org
2011-09-26 20:06 ` ccoutant at gcc dot gnu.org
2011-10-19  0:02 ` pinskia at gcc dot gnu.org
2011-10-19  0:04 ` pinskia at gcc dot gnu.org
2009-07-22 23:28 [Bug c++/40831] New: " cgd at google dot com
2009-07-22 23:29 ` [Bug c++/40831] " cgd at google dot com
2009-07-22 23:36 ` pinskia at gcc dot gnu dot org
2009-07-22 23:37 ` pinskia at gcc dot gnu dot org
2009-07-22 23:45 ` cgd at google dot com

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-40831-4-1o0df4SCpj@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).