Blame SOURCES/gcc48-pr68184.patch

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