https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103802

--- Comment #4 from luoxhu at gcc dot gnu.org ---
Or restore the previous recip count check by comment out the if condition to
avoid bb in loop turns cold?

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
b/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
index 641c91e719e..d3c3053486d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
@@ -14,7 +14,13 @@ float h ()
        E = 1. - d;

        for( i=0; i < 2; i++ )
-               if( d > 0.01 )
+               // if( d > 0.01 )
+               /* The if condition will make followed bb cold (profile count
+                  less then the loop preheader), while r12-6087 is a
+                  optimization that avoids move COLD invariant expression out
+                  of loop, since this test case is to test recip expression
+                  could be CSE and eliminated, so comment the condition to
keep
+                  the test point.  */
                {
                        P = ( W < E ) ? (W - E)/d : (E - W)/d;
                        F[i] += P;
@@ -23,4 +29,4 @@ float h ()
        F[0] += E / d;
 }

-/* { dg-final { scan-tree-dump-times " / " 5 "recip" } } */
+/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */

Reply via email to