public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: Martin Jambor <mjambor@suse.cz>,
	Richard Guenther <rguenther@suse.de>,
	       gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix incorrect devirtualization (PR middle-end/48661)
Date: Tue, 19 Apr 2011 07:46:00 -0000	[thread overview]
Message-ID: <20110419070735.GF17079@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <4DACBC2E.3000304@redhat.com>

On Mon, Apr 18, 2011 at 03:33:18PM -0700, Jason Merrill wrote:
> On 04/18/2011 02:40 PM, Jakub Jelinek wrote:
> >If TREE_BINFO has BV_VCALL_INDEX set, this needs to be dynamically
> >adjusted, but none of the callers are prepared to handle that.
> 
> Well, it means that we do dynamic adjustment at runtime.  If we're
> able to do devirtualization, we should be able to figure out the
> right offset as well, just not in 4.6.

Sure, but how exactly?  If BV_VCALL_INDEX is non-NULL,
I guess we need to find for the given binfo corresponding rtti_binfo
that was (or would be if vtable isn't emitted in the current TU)
used in build_rtti_vtbl_entries to compute the difference between
BINFO_OFFSETs:
  offset = size_diffop_loc (input_location,
                        BINFO_OFFSET (vid->rtti_binfo), BINFO_OFFSET (b));
That is the value actually added on top of the fixed delta, right?
Or do you think it should just add to the delta the value read from the
vcall_offset from the vtable?

But first of all PR48674 needs solving on the trunk.
I think cgraph thunk nodes have fixed_offset field so it is easy to figure
out that adjustment, but for vcall_offset adjustment the same applies here,
is there a way to find out what value will be added, or does it need to be
dynamic?  And what kind of info do we need to find that out.

	Jakub

  reply	other threads:[~2011-04-19  7:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 22:33 Jakub Jelinek
2011-04-18 23:35 ` Richard Guenther
2011-04-18 23:43 ` Jason Merrill
2011-04-19  7:46   ` Jakub Jelinek [this message]
2011-04-19 23:37     ` Jason Merrill
2011-04-20 14:32     ` Martin Jambor
2011-04-19  0:07 ` H.J. Lu
2011-04-19  0:21 ` Jan Hubicka
2011-04-19  0:24   ` Jan Hubicka
2011-04-19  8:58     ` Richard Guenther
2011-04-19 10:27       ` Jan Hubicka
2011-04-19 10:51         ` Richard Guenther
2011-04-19 11:12           ` Jan Hubicka
2011-04-19 11:30             ` Richard Guenther
2011-04-19 14:59               ` Jan Hubicka
2011-04-19 14:59                 ` Richard Guenther
2011-04-19 15:00                   ` Jan Hubicka
2011-04-20 14:50     ` Martin Jambor
2011-04-20 15:06       ` Jan Hubicka
2011-04-20 15:25         ` Richard Guenther
2011-04-20 15:35           ` Jan Hubicka
2011-04-20 15:28         ` Martin Jambor

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=20110419070735.GF17079@tyan-ft48-01.lab.bos.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=mjambor@suse.cz \
    --cc=rguenther@suse.de \
    /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).