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]

Fix IPA_NODE_REF call in evaluate_properties_for_edge


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.
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;
 }


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