Blame SOURCES/gcc48-pr68184.patch

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