From: Jan Hubicka <hubicka@ucw.cz>
To: Benjamin Redelings <benjamin.redelings@duke.edu>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches@gcc.gnu.org
Subject: Re: pure virtual method called
Date: Fri, 14 Feb 2014 20:21:00 -0000 [thread overview]
Message-ID: <20140214202116.GA18257@kam.mff.cuni.cz> (raw)
In-Reply-To: <52FE7A37.2020305@duke.edu>
Hi,
the testcase would be wonderful - those bugs are hard to catch. I fixed some issues
recently, so you may try recent snapshot if you didn't.
You may try -fno-devirtualize to see if the bug goes away (likely it will) and you
may try to look in -fdump-tree-all -fdump-ipa-all dumps where cxa_pure_virtual call
appears in the program and send me some context.
Honza
> Hi Jan,
>
> I hope to report a bug soon, but in the meantime I wanted to let
> you know that for the last month or so, the 4.9 branch has (I think)
> a bug at O3, where my program gets:
>
> pure virtual method called
> terminate called without an active exception
> Aborted
>
> 4.8 works fine.
>
> I am guessing this is related to your devirt work. I haven't
> been able to produce a reduce testcase yet (sorry!), but here is
> some code that illustrates the C++ type for the object whose virtual
> table is (?) messed up. (Note: this code compiles but does NOT
> crash.)
>
> Again, sorry for not having a testcase. I'll make one soon.
> Hopefully it is helpful to know that bugs still exist.
>
> -BenRI
>
> #include <vector>
>
> class Object
> {
> virtual Object* clone() const =0;
> };
>
> template <typename T>
> class Box: public Object, public T
> {
> public:
> Box<T>* clone() const {return new Box<T>(*this);}
> };
>
> template <typename T>
> using Vector = Box<std::vector<T>>;
>
> int main()
> {
> Vector<int> v;
> v.clone();
> }
>
> -BenRI
>
> P.S. The bug exists in debian gcc snapshots taken on 2014-02-12 and
> 2014-01-22, Linux AMD64.
next prev parent reply other threads:[~2014-02-14 20:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 20:35 [PATCH, PR 45699] Devirtualize to thunks Benjamin Redelings I
2010-10-13 12:26 ` Martin Jambor
2014-02-14 20:19 ` pure virtual method called Benjamin Redelings
2014-02-14 20:21 ` Jan Hubicka [this message]
2014-02-14 20:48 ` Benjamin Redelings
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=20140214202116.GA18257@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--cc=benjamin.redelings@duke.edu \
--cc=gcc-patches@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).