Fix IPA_NODE_REF call in evaluate_properties_for_edge
diff mbox series

Message ID 20191109213634.gzxuuxldyadq4eje@kam.mff.cuni.cz
State New
Headers show
Series
  • Fix IPA_NODE_REF call in evaluate_properties_for_edge
Related show

Commit Message

Jan Hubicka Nov. 9, 2019, 9:36 p.m. UTC
Hi,
evaluate_properties_for_edge may call IPA_NODE_REF on alias which makes no
sense. Fixed thus.

Bootstrapped/regtested x86_64-linux. Comitted.

	* ipa-fnsummary.c (evaluate_properties_for_edge): Call IPA_NODE_REF
	on function symbol.
	* gcc.dg/tree-ssa/pr46076.c: Make tested code hot.

Patch
diff mbox series

Index: ipa-fnsummary.c
===================================================================
--- ipa-fnsummary.c	(revision 278007)
+++ ipa-fnsummary.c	(working copy)
@@ -474,7 +474,7 @@  evaluate_properties_for_edge (struct cgr
 	caller_parms_info = IPA_NODE_REF (e->caller->inlined_to);
       else
 	caller_parms_info = IPA_NODE_REF (e->caller);
-      callee_pi = IPA_NODE_REF (e->callee);
+      callee_pi = IPA_NODE_REF (callee);
 
       if (count && (info->conds || known_vals_ptr))
 	known_vals.safe_grow_cleared (count);
Index: testsuite/gcc.dg/tree-ssa/pr46076.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr46076.c	(revision 278007)
+++ testsuite/gcc.dg/tree-ssa/pr46076.c	(working copy)
@@ -19,9 +19,12 @@  main()
 {
   /* Make sure we perform indirect inlining of one and two and optimize
      the result to a constant.  */
-  if (print(one) != 3)
-    link_error ();
-  if (print(two) != 5)
-    link_error ();
+  for (int i = 0; i < 100; i++)
+    {
+      if (print(one) != 3)
+	link_error ();
+      if (print(two) != 5)
+	link_error ();
+    }
   return 0;
 }