Remove forgotten early return in ipa_value_range_from_jfunc
authorJan Hubicka <jh@suse.cz>
Thu, 25 Nov 2021 22:58:48 +0000 (23:58 +0100)
committerJan Hubicka <jh@suse.cz>
Thu, 25 Nov 2021 22:58:48 +0000 (23:58 +0100)
gcc/ChangeLog:

* ipa-cp.c (ipa_value_range_from_jfunc): Remove forgotten early return.

gcc/testsuite/ChangeLog:

* gcc.dg/ipa/inline10.c: New test.

gcc/ipa-cp.c
gcc/testsuite/gcc.dg/ipa/inline10.c [new file with mode: 0644]

index 703541d..5d9bb97 100644 (file)
@@ -1620,7 +1620,6 @@ ipa_value_range_from_jfunc (ipa_node_params *info, cgraph_edge *cs,
                            ipa_jump_func *jfunc, tree parm_type)
 {
   value_range vr;
-  return vr;
   if (jfunc->m_vr)
     ipa_vr_operation_and_type_effects (&vr,
                                       jfunc->m_vr,
diff --git a/gcc/testsuite/gcc.dg/ipa/inline10.c b/gcc/testsuite/gcc.dg/ipa/inline10.c
new file mode 100644 (file)
index 0000000..81884b4
--- /dev/null
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -c -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining"  } */
+void link_error ();
+int
+test(int a)
+{
+  if (a>10)
+       {
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+               link_error ();
+       }
+}
+int test2()
+{
+       for (int i=0;i<10;i++)
+               test(i);
+}
+/* { dg-final { scan-ipa-dump "Known to be false: not inlined, op0 > 10"  "inline"  } } */
+/* { dg-final { scan-ipa-dump "Inlined test"  "inline"  } } */