public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: 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 17:34:00 -0000	[thread overview]
Message-ID: <m31xo9vo6i.fsf@uniton.integrable-solutions.net> (raw)
In-Reply-To: <oroerdzxjc.fsf@free.redhat.lsd.ic.unicamp.br>

Alexandre Oliva <aoliva@redhat.com> writes:

| On Mar  3, 2004, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| 
| > I believe you completely missed what I was saying.
| 
| No.  You're just thinking of a completely different issue.  I'm
| talking about a case that can't possibly be optimized by GCC without
| an extension, because the optimization would be wrong.  You're
| pointing out cases in which GCC fails to apply an optimization that
| would be correct.  Both are related with turning virtual calls into
| direct calls, but they're not the same.

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.
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.

-- Gaby

  reply	other threads:[~2004-03-03 17:34 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 [this message]
2004-03-03 18:12                                   ` Joe Buck
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=m31xo9vo6i.fsf@uniton.integrable-solutions.net \
    --to=gdr@integrable-solutions.net \
    --cc=aoliva@redhat.com \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --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).