public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [ARM, Callgraph] Fix PR67280: function incorrectly marked as nothrow
@ 2015-08-28 15:08 Charles Baylis
  2015-09-01 21:00 ` Jeff Law
  0 siblings, 1 reply; 7+ messages in thread
From: Charles Baylis @ 2015-08-28 15:08 UTC (permalink / raw)
  To: Jan Hubicka, Ramana Radhakrishnan, Kyrylo Tkachov, Richard Earnshaw
  Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

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 #2: 0001-fix-up-can_throw_external-in-cgraph_node-create_wrap.patch --]
[-- Type: application/x-download, Size: 961 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-16 15:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28 15:08 [PATCH] [ARM, Callgraph] Fix PR67280: function incorrectly marked as nothrow Charles Baylis
2015-09-01 21:00 ` Jeff Law
2015-09-02 12:09   ` Jan Hubicka
2015-09-07  8:48     ` Charles Baylis
2015-09-07  9:27       ` Ramana Radhakrishnan
2015-09-20 23:55       ` Charles Baylis
2015-11-16 15:03         ` Charles Baylis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).