C++: Letting compiler know asm block can call function that can throw?

Stephan Bergmann sbergman@redhat.com
Thu Mar 29 12:51:00 GMT 2012


On 03/29/2012 11:16 AM, Richard Guenther wrote:
> On Thu, Mar 29, 2012 at 10:47 AM, Stephan Bergmann<sbergman@redhat.com>  wrote:
>> So an explicit -fnon-call-exceptions on the command line seems to indeed
>> help.  Unfortunately, moving that into a
>>
>>   #pragma GCC optimize ("non-call-exceptions")
>>
>> at the top of the source file that defines callVirtualMethod (and nothing
>> more) does *not* work.  Is that a bug?
>
> The optimize pragma has only very limited support for this kind of options,
> so yes, it's techincally a bug but don't hold your breath.

OK.  (It's just that the way LibreOffice is build, its a PITA to compile 
a single file with differing options...)

>> Anyway, would it be worthwhile filing an RFE for an asm annotation telling
>> the compiler that it contains code that can throw?
>
> I suppose yes.

<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52770> "RFE: Letting 
compiler know asm block can call function that can throw."

Thanks,
Stephan



More information about the Gcc mailing list