public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* regarding https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
@ 2019-05-16  2:41 kamlesh kumar
  0 siblings, 0 replies; only message in thread
From: kamlesh kumar @ 2019-05-16  2:41 UTC (permalink / raw)
  To: gcc, Jan Hubicka

Hi devs,
I am looking into subjected issue.
consider below testcase.
$test.cpp
class A {
public:
    virtual int value() { return 1; }
};

class  B final : public A {
public:
    int value(){ return 2; }
};
int test(A* b) {
    return b->value() + 11;
}
void foo_test(B*b)
{
test(b);
}
Here gcc is unable to devirtualize the call to value into the test, because
type information is not being propogated from foo_test to test.
So this is what i am trying to do to make devirtualization happen:

First we can inline the function test into foo_test.
And then update the type in the OBJ_TYPE_REF.
so that devirtualization can be applied.
Like to know your thought before going ahead.

./Kamlesh

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-16  2:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16  2:41 regarding https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924 kamlesh kumar

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