This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, 4.4, PR 42231] Redirect new indirect edges in ipa-cp during cgraph update


Hi,

On Fri, Dec 11, 2009 at 03:27:08PM +0100, Jan Hubicka wrote:
> > 2009-12-08  Martin Jambor  <mjambor@suse.cz>
> > 
> > 	PR tree-optimization/42231
> > 	* ipa-cp.c (ipcp_update_cloned_node): Add missing edges manually
> > 	instead of relying on rebuild_cgraph_edges and mark them as
> > 	indirect calls.
> > 	(ipcp_update_callgraph): Always redirect indirect edges.
> > 
> > 	* testsuite/gcc.c-torture/execute/pr42231.c: New test.
> OK,
> thanks!

Thanks, I have re-tested the patch and committed it.  I have also
committed the one below to trunk to add the testcase to it too.

Martin


2009-12-27  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/42231
	* testsuite/gcc.c-torture/execute/pr42231.c: New test.
	
Index: gcc/testsuite/gcc.c-torture/execute/pr42231.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr42231.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/execute/pr42231.c	(revision 0)
@@ -0,0 +1,35 @@
+extern void abort (void);
+
+static max;
+
+static void __attribute__((noinline)) storemax (int i)
+{
+  if (i > max)
+    max = i;
+}
+
+static int CallFunctionRec(int (*fun)(int depth), int depth) {
+  if (!fun(depth)) {
+    return 0;
+  }
+  if (depth < 10) {
+    CallFunctionRec(fun, depth + 1);
+  }
+  return 1;
+}
+
+static int CallFunction(int (*fun)(int depth)) {
+  return CallFunctionRec(fun, 1) && !fun(0);
+}
+
+static int callback(int depth) {
+  storemax (depth);
+  return depth != 0;
+}
+
+int main() {
+  CallFunction(callback);
+  if (max != 10)
+    abort ();
+  return 0;
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]