------- Comment #20 from rguenth at gcc dot gnu dot org  2007-02-05 09:06 
-------
What we want to prevent with the patch for PR29323 is the TREE_NOTHROW flag
propagating to a locally binding function.  Consider

void foo() nothrow __attribute__((weak)) {}

void bar()
{
  foo();
}

we need EH unwind data emitted for bar() even if foo() is marked or
analyzed as nothrow as at run time bar() might call a foo() that throws.

At least if using C and -fexceptions this is a valid use (we of course
can declare this invalid for C++, but this can be a runtime error only
which will then be hard to diagnose).

I'm in no way expert enough to say if we can omit EH data for foo() in
the above case (we probably can), but if so then splitting the TREE_NOTHROW
flag into two is probably the right thing to go.

I suppose PR29323 was found by inspection of GCC code rather than a real-world
testcase so the option to revert that patch on the 4.1 branch looks appealing.

(CCed Joern to clarify)


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29487

Reply via email to