Hi

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
incorrect unwinding tables. (more details on bugzilla)

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.

This patch passed make check with no new regressions on gcc-5-branch
on arm-linux-gnueabihf using qemu.

I will do a bootstrap on ARM hardware over the weekend. Do I also need
to test x86_64?

I plan to add a test case, but it seems it's worth getting review for
the approach in the mean time.

Thanks,
Charles


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.

Attachment: 0001-fix-up-can_throw_external-in-cgraph_node-create_wrap.patch
Description: application/download

Reply via email to