Blame SOURCES/gcc48-pr68184.patch

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