public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joe Buck <Joe.Buck@synopsys.COM>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: Alexandre Oliva <aoliva@redhat.com>,
	Daniel Berlin <dberlin@dberlin.org>,
	Kevin Atkinson <kevina@gnu.org>,
	Mark Mielke <mark@mark.mielke.cc>,
	gcc@gcc.gnu.org, Jeff Sturm <jsturm@one-point.com>,
	Nathan Sidwell <nathan@codesourcery.com>
Subject: Re: RFC: New C++ Attribute: final
Date: Wed, 03 Mar 2004 18:12:00 -0000	[thread overview]
Message-ID: <20040303101229.A8644@synopsys.com> (raw)
In-Reply-To: <m31xo9vo6i.fsf@uniton.integrable-solutions.net>; from gdr@integrable-solutions.net on Wed, Mar 03, 2004 at 06:24:37PM +0100

On Wed, Mar 03, 2004 at 06:24:37PM +0100, Gabriel Dos Reis wrote:
> More to the point, the case I just pointed out *is* an instance where
> the function has final semantics and the compiler knows that. 
> 
>   (1) In my case, it is known after the class foobar definition
>       that foobar::fun is final.  The compiler does not optimize the
>       vcall.  I don't think a keyword is needed for that.
>       Usage of local classes like that are common.
> 
>   (2) in the testcase I gave to Joe, I'm pointing out that GCC still
>       don't quite understand pointer-to-member-function and optimize
>       accordingly. And this is a case where all information are
>       available, in the specific context the call is made.
> 
> I'm saying that given both (1) and (2), it looks like we would be
> trumping people, for they are already saying "final" and we don't optimize.

Agreed; the first thing we need to do is get the compiler to do a better
job generating good code for ISO C++.

> Those two cases do not cover all the semantics that a putative "final"
> may have; but if we optimize those cases  (which are quite common,
> probably more common than the other corner cases) then we may be more
> credible in saying that a keyword is needed to do a better job.

I am interested in "final" not just to do a better job of optimization,
but also for improved safety; there are many codes that implicitly assume
"final" for correct operation (some gurus believe such codes are "broken"
but any GNU/Linux distro is full of such "broken" code).  Just the same,
Gaby is right; we need to do a better job of avoiding virtual calls in
cases where the compiler already can determine that a specific function
must be called.

  reply	other threads:[~2004-03-03 18:12 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-29  5:50 Kevin Atkinson
2004-02-29  6:51 ` Mark Mielke
2004-02-29  6:56   ` Kevin Atkinson
2004-03-01 10:20     ` Nathan Sidwell
2004-03-01 13:51       ` Per Abrahamsen
2004-03-01 20:58         ` Kevin Atkinson
2004-03-01 23:05         ` Robert Dewar
2004-03-01 14:51       ` Jeff Sturm
2004-03-01 15:02         ` Gabriel Dos Reis
2004-03-01 15:04         ` Nathan Sidwell
2004-03-01 18:53           ` Joe Buck
2004-03-02 10:01             ` Nathan Sidwell
2004-03-01 19:39           ` Jeff Sturm
2004-03-01 19:57             ` Gabriel Dos Reis
2004-03-01 20:18               ` Joe Buck
2004-03-01 20:57                 ` Gabriel Dos Reis
2004-03-01 21:22                   ` Joe Buck
2004-03-01 21:40                     ` Gabriel Dos Reis
2004-03-02 16:59               ` Alexandre Oliva
2004-03-02 17:33                 ` Gabriel Dos Reis
2004-03-02 22:54                   ` Alexandre Oliva
2004-03-02 23:24                     ` Daniel Berlin
2004-03-03  0:09                       ` Richard Henderson
2004-03-03  0:23                         ` Dale Johannesen
2004-03-03  0:33                           ` Richard Henderson
2004-03-03  0:39                             ` Dale Johannesen
2004-03-03  0:27                       ` Alexandre Oliva
2004-03-03  0:57                         ` Gabriel Dos Reis
2004-03-03  3:53                           ` Alexandre Oliva
2004-03-03 11:08                             ` Gabriel Dos Reis
2004-03-03 16:49                               ` Alexandre Oliva
2004-03-03 17:34                                 ` Gabriel Dos Reis
2004-03-03 18:12                                   ` Joe Buck [this message]
2004-03-03 19:04                             ` Gabriel Dos Reis
2004-03-03  0:52                     ` Gabriel Dos Reis
2004-03-03  1:51                       ` Joe Buck
2004-03-03 11:37                         ` Gabriel Dos Reis
2004-03-01 18:45       ` Joe Buck
2004-03-01 18:56         ` Gabriel Dos Reis
2004-03-01 19:11           ` Joe Buck
2004-03-01 19:48             ` Gabriel Dos Reis
2004-03-01 20:09               ` Joe Buck
2004-03-01 20:37                 ` Gabriel Dos Reis
2004-03-01 18:34   ` Joe Buck
2004-02-29  7:18 ` Phil Edwards
2004-03-01  6:15   ` Kevin Atkinson
2004-03-01  8:04     ` Kevin Atkinson
2004-03-02 20:58 ` Matt Austern
2004-03-02 21:24   ` George Garvey
2004-03-03  1:21     ` Gabriel Dos Reis
2004-03-02 23:10   ` Joe Buck
2004-03-03  0:30     ` Alexandre Oliva
2004-03-01 19:03 Cheng, Cheuk
2004-03-01 19:34 Chris Lattner
2004-03-03  0:33 Robert Dewar

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=20040303101229.A8644@synopsys.com \
    --to=joe.buck@synopsys.com \
    --cc=aoliva@redhat.com \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=jsturm@one-point.com \
    --cc=kevina@gnu.org \
    --cc=mark@mark.mielke.cc \
    --cc=nathan@codesourcery.com \
    /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).