This is the mail archive of the
mailing list for the GCC project.
Re: C++: Letting compiler know asm block can call function that can throw?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Stephan Bergmann <sbergman at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 29 Mar 2012 09:44:11 +0200
- Subject: Re: C++: Letting compiler know asm block can call function that can throw?
- References: <4F7409B9.firstname.lastname@example.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 29, 2012 at 09:05:29AM +0200, Stephan Bergmann wrote:
> In LibreOffice's ever-beloved low-level code to synthesize calls to
> C++ virtual functions, I'm having the following problem (on Linux
> x86_64). The function callVirtualMethod at <http://cgit.freedesktop.org/libreoffice/core/tree/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx?id=571876c1234ae55aab0198c7e2caf9049fcd230e#n61>
> effectively does the following:
> First, call dummy_can_throw_anything that can potentially throw (see
> below for why that's there). Second, in an asm block, call some
> virtual function (that can potentially throw). Third, call
> x86_64::fill_struct that can potentially throw (it doesn't, but
> nobody bothered to annotate it as "throw ()").
If the asm isn't in headers, but just in a single short source file
or two, you could try compiling that file with -fnon-call-exceptions.
It is nothing I'd recommend for the whole codebase though.