public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/14639] [3.4/3.5 Regression] [unit-at-a-time] Incorrect emission of unused compiler-generated destructor at -O2
Date: Fri, 26 Mar 2004 08:23:00 -0000	[thread overview]
Message-ID: <20040326082335.9934.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040318204634.14639.austern@apple.com>


------- Additional Comments From mark at codesourcery dot com  2004-03-26 08:23 -------
Subject: Re:  [3.4/3.5 Regression] [unit-at-a-time] Incorrect
 emission of unused compiler-generated destructor at -O2

hubicka at ucw dot cz wrote:

> It will fix the problem because the thunk is only output at the time
> function is assembled.  But it will make mark_referenced useless anyway
> as when the function is assembled it is already mark_reference-d.
> Removing the call as done by my patch should be fine then, but we must
> ensure that referencing the vtable that references the thunk makes
> cgraph code notice that the function referenced by the thunk is
> referenced too, so the dependencies goes right.  I am not quite sure how
> to construct testcase, but I will try to dig into it.  Obviously the
> testsuite works so it seems to be fine in majority of case but my
> experience is that there are common dead ends not covered by testsuite
> in these areas, so I still feel unsafe about that patch, but all my
> attempts to construct testcase seems to be failing.

I am not sure that the case you are worried about can happen.

For that to happen, there would have to be a vtable that contains a 
reference to a thunk, but no references to the function to which the 
thunk refers.  The only way a thunk to C::f can occur is in a vtable for 
  C, or a base subobject of C.  But, in that case, C::f will also be 
referenced directly from the vtable.

>>>How much incredible it is?  (ie having testcase that exhibits a lot of
>>>unnecesary thunks/vtables would be usefull too). 
>>
>>Just take the original test case, but add thousands of classes.  That's 
>>a very typical situation for some class frameworks.
> 
> 
> We obvisouly emit unnecesary thunks, lets see what we can do about this.
> I tried to compile mozilla with the patch fixing the testcase and
> measured no difference in code size tought...

Many of the "unncessary" thunks are required by the ABI.  The ABI 
guarantees that all thunks are put out with the function to which they 
transfer control.

Based on our discussion, I think your patch is OK.  Please check it in, 
but remove the call to mark_referenced copmletely, rather than 
commenting it out.

Thanks,



-- 


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


  parent reply	other threads:[~2004-03-26  8:23 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18 20:46 [Bug c++/14639] New: " austern at apple dot com
2004-03-19  1:33 ` [Bug c++/14639] [3.4/3.5 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-03-19  2:27 ` mmitchel at gcc dot gnu dot org
2004-03-19  4:02 ` austern at apple dot com
2004-03-19  4:44 ` mark at codesourcery dot com
2004-03-21 18:26 ` hubicka at ucw dot cz
2004-03-21 18:26 ` [Bug c++/14639] New: " Jan Hubicka
2004-03-21 19:25   ` Mark Mitchell
2004-03-22  9:44     ` Jan Hubicka
2004-03-22 15:31       ` Mark Mitchell
2004-03-23  9:52         ` Jan Hubicka
2004-03-21 19:25 ` [Bug c++/14639] [3.4/3.5 Regression] [unit-at-a-time] " mark at codesourcery dot com
2004-03-21 23:33 ` steven at gcc dot gnu dot org
2004-03-22  9:44 ` jh at suse dot cz
2004-03-22 15:32 ` mark at codesourcery dot com
2004-03-23  9:52 ` jh at suse dot cz
2004-03-23 21:25 ` mark at codesourcery dot com
2004-03-23 21:26 ` mmitchel at gcc dot gnu dot org
2004-03-23 21:26 ` mmitchel at gcc dot gnu dot org
2004-03-24 18:23 ` hubicka at ucw dot cz
2004-03-24 18:44 ` mark at codesourcery dot com
2004-03-24 23:51 ` hubicka at ucw dot cz
2004-03-26  8:23 ` mark at codesourcery dot com [this message]
2004-03-26 10:01 ` hubicka at ucw dot cz
2004-03-28 15:42 ` cvs-commit at gcc dot gnu dot org
2004-03-30 13:46 ` [Bug c++/14639] [3.5 " pinskia at gcc dot gnu dot org
2004-06-03 23:27 ` bowdidge at apple dot com
2004-06-03 23:33 ` pinskia at gcc dot gnu dot org
2004-06-03 23:35 ` pinskia at gcc dot gnu dot org
2004-06-03 23:38 ` mark at codesourcery dot com
2004-06-03 23:38 ` bowdidge at apple dot com
2004-06-03 23:45 ` cvs-commit at gcc dot gnu dot org
2004-06-03 23:46 ` pinskia at gcc dot gnu dot org
2004-06-04  0:37 ` bowdidge at apple dot com
2004-06-04  0:38 ` bowdidge at apple dot com
2004-06-04  0:40 ` pinskia at gcc dot gnu dot org
2004-06-04  0:50 ` [Bug c++/14639] [3.5 Regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-06-04  0:58 ` [Bug c++/14639] [3.5 Regression] [non-unit-at-a-time] Incorrect emission of unused compiler-generated destructor bowdidge at apple dot com
2004-06-04  1:09 ` pinskia at gcc dot gnu dot org
2004-06-04  1:50 ` pinskia at gcc dot gnu dot org
2004-06-04  2:12 ` bowdidge at apple dot com
2004-06-04  2:19 ` pinskia at gcc dot gnu dot org
2004-06-04  2:20 ` pinskia at gcc dot gnu dot org
2004-06-04  2:47 ` pinskia at gcc dot gnu dot org
2004-06-04  3:45 ` bowdidge at apple dot com
2004-06-04  4:53 ` bowdidge at apple dot com
2004-06-04  4:58 ` pinskia at gcc dot gnu dot org
2004-06-04 19:13 ` bowdidge at apple dot com
2004-06-04 21:04 ` hubicka at ucw dot cz
2004-06-04 21:11 ` hubicka at ucw dot cz
2004-06-04 21:15 ` bowdidge at apple dot com
2004-06-04 21:16 ` hubicka at ucw dot cz
2004-06-04 21:54 ` bowdidge at apple dot com
2004-06-04 22:59 ` bowdidge at apple dot com
2004-06-05  0:58 ` bowdidge at apple dot com
2004-06-05  1:02 ` bowdidge at apple dot com
2004-06-05  1:19 ` pinskia at gcc dot gnu dot org
2004-06-14 23:56 ` pinskia at gcc dot gnu dot org
2004-06-15  3:43 ` pinskia at gcc dot gnu dot org
2004-06-15 20:52 ` pinskia at gcc dot gnu dot org
2004-06-15 20:52 ` cvs-commit at gcc dot gnu dot org
2004-07-29 18:09 ` 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=20040326082335.9934.qmail@sources.redhat.com \
    --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).