> >This patch is an attempt to fix > >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67280. I have written up > >an analysis of the bug there. > > > >When cgraph_node::create_wrapper() updates the callgraph for the new > >function, it sets the can_throw_external flag to false, even when > >wrapping a function which can throw. This causes the ipa-pure-const > >phase to mark the wrapper function as nothrow which results in Oops... > >incorrect unwinding tables. (more details on bugzilla) > Seems clearly wrong. I wonder if there are other properties that > should be set but aren't in the thunk.
can_throw_external seems to be only one. > > > > >The attached patch addresses the problem in > >cgraph_node::create_wrapper(). A slightly more general approach would > >be to change symbol_table::create_edge() so that it checks > >TREE_NOTHROW(callee->decl) when call_stmt is NULL. > I'm not well versed in the cgraph code -- my worry with this > approach would be that the wrapper's state is inconsistent with what > the wrapper can call. It seems cleaner to make sure these various > flags are correct when we create the wrapper. It kind of sucks that one needs to mind this flag each time one creates edge, but setting the value in create_edge is not quite correct as that one does not have any information on where the call appears and if the exception is not handled locally. > >gcc/ChangeLog: > > > >2015-08-28 Charles Baylis <charles.bay...@linaro.org> > > > > * cgraphunit.c (cgraph_node::create_wrapper): Set can_throw_external > > in new callgraph edge. > Ultimately Jan's call. This is OK. Thanks for looking into this! Honza > > Jeff