|
|
001c85 |
2017-02-28 Jakub Jelinek <jakub@redhat.com>
|
|
|
001c85 |
|
|
|
001c85 |
Backport from mainline
|
|
|
001c85 |
2015-12-02 Jan Hubicka <hubicka@ucw.cz>
|
|
|
001c85 |
|
|
|
001c85 |
PR ipa/68184
|
|
|
001c85 |
* cgraphunit.c (cgraph_node::analyze): Set can_throw_external.
|
|
|
001c85 |
|
|
|
001c85 |
* g++.dg/torture/pr68184.C: New testcase.
|
|
|
001c85 |
|
|
|
001c85 |
--- gcc/cgraphunit.c.jj 2014-09-10 09:15:51.000000000 +0200
|
|
|
001c85 |
+++ gcc/cgraphunit.c 2017-02-28 08:24:44.387385510 +0100
|
|
|
001c85 |
@@ -626,8 +626,10 @@ cgraph_analyze_function (struct cgraph_n
|
|
|
001c85 |
}
|
|
|
001c85 |
else if (node->thunk.thunk_p)
|
|
|
001c85 |
{
|
|
|
001c85 |
- cgraph_create_edge (node, cgraph_get_node (node->thunk.alias),
|
|
|
001c85 |
- NULL, 0, CGRAPH_FREQ_BASE);
|
|
|
001c85 |
+ struct cgraph_node *t = cgraph_get_node (node->thunk.alias);
|
|
|
001c85 |
+ cgraph_create_edge (node, t, NULL, 0,
|
|
|
001c85 |
+ CGRAPH_FREQ_BASE)->can_throw_external
|
|
|
001c85 |
+ = !TREE_NOTHROW (t->symbol.decl);
|
|
|
001c85 |
}
|
|
|
001c85 |
else if (node->dispatcher_function)
|
|
|
001c85 |
{
|
|
|
001c85 |
--- gcc/testsuite/g++.dg/torture/pr68184.C.jj 2017-02-28 08:26:09.205246069 +0100
|
|
|
001c85 |
+++ gcc/testsuite/g++.dg/torture/pr68184.C 2015-12-03 16:39:34.589010321 +0100
|
|
|
001c85 |
@@ -0,0 +1,31 @@
|
|
|
001c85 |
+// { dg-do run }
|
|
|
001c85 |
+namespace {
|
|
|
001c85 |
+struct IFoo { virtual void foo() = 0; };
|
|
|
001c85 |
+struct IBar { virtual void bar() = 0; };
|
|
|
001c85 |
+
|
|
|
001c85 |
+struct FooBar : private IBar, private IFoo
|
|
|
001c85 |
+{
|
|
|
001c85 |
+ void call_foo()
|
|
|
001c85 |
+ {
|
|
|
001c85 |
+ try
|
|
|
001c85 |
+ {
|
|
|
001c85 |
+ static_cast<IFoo*>(this)->foo();
|
|
|
001c85 |
+ }
|
|
|
001c85 |
+ catch( ... ) {}
|
|
|
001c85 |
+ }
|
|
|
001c85 |
+ void foo() { throw 1; }
|
|
|
001c85 |
+ void bar() {}
|
|
|
001c85 |
+};
|
|
|
001c85 |
+
|
|
|
001c85 |
+void test()
|
|
|
001c85 |
+{
|
|
|
001c85 |
+ FooBar foobar;
|
|
|
001c85 |
+ foobar.call_foo();
|
|
|
001c85 |
+}
|
|
|
001c85 |
+}
|
|
|
001c85 |
+int main()
|
|
|
001c85 |
+{
|
|
|
001c85 |
+ test();
|
|
|
001c85 |
+ return 0;
|
|
|
001c85 |
+}
|
|
|
001c85 |
+
|