This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [ARM, Callgraph] Fix PR67280: function incorrectly marked as nothrow


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.baylis@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]