diff mbox series

correct comments in tree-prof/inliner-1.c

Message ID e398fd68-e5b3-f23b-6d0c-fa698ae49daa@gmail.com
State New
Headers show
Series correct comments in tree-prof/inliner-1.c | expand

Commit Message

Martin Sebor Feb. 11, 2019, 4:32 p.m. UTC
I noticed the comments in the test don't correspond to what it's
designed to exercise: namely that the call to hot_function() is
inlined and the call to cold_function() is not, rather than
the other way around.

Attached is a patch that adjusts the comments.  Honza, please let
me know if this looks correct to you.

Thaks
Martin

Comments

Jan Hubicka Feb. 11, 2019, 4:35 p.m. UTC | #1
> I noticed the comments in the test don't correspond to what it's
> designed to exercise: namely that the call to hot_function() is
> inlined and the call to cold_function() is not, rather than
> the other way around.
> 
> Attached is a patch that adjusts the comments.  Honza, please let
> me know if this looks correct to you.
> 
> Thaks
> Martin

> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/tree-prof/inliner-1.c: Correct comments.

This looks ok, thanks!
Honza

> 
> Index: gcc/testsuite/gcc.dg/tree-prof/inliner-1.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/tree-prof/inliner-1.c	(revision 268755)
> +++ gcc/testsuite/gcc.dg/tree-prof/inliner-1.c	(working copy)
> @@ -28,15 +28,15 @@ main ()
>    for (i = 0; i < 1000000; i++)
>      {
>        if (a)
> -        cold_function ();
> +        cold_function ();   /* Should not be inlined.  */
>        else
> -        hot_function ();
> +        hot_function ();    /* Should be inlined.  */
>      }
>    return 0;
>  }
>  
> -/* cold function should be inlined, while hot function should not.  
> -   Look for "cold_function () [tail call];" call statement not for the
> -   declaration or other appearances of the string in dump.  */
> +/* The call to hot_function should be inlined, while cold_function should
> +   not be.  Look for the "cold_function ();" call statement and not for
> +   its declaration or other occurrences of the string in the dump.  */
>  /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
>  /* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
diff mbox series

Patch

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-prof/inliner-1.c: Correct comments.

Index: gcc/testsuite/gcc.dg/tree-prof/inliner-1.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-prof/inliner-1.c	(revision 268755)
+++ gcc/testsuite/gcc.dg/tree-prof/inliner-1.c	(working copy)
@@ -28,15 +28,15 @@  main ()
   for (i = 0; i < 1000000; i++)
     {
       if (a)
-        cold_function ();
+        cold_function ();   /* Should not be inlined.  */
       else
-        hot_function ();
+        hot_function ();    /* Should be inlined.  */
     }
   return 0;
 }
 
-/* cold function should be inlined, while hot function should not.  
-   Look for "cold_function () [tail call];" call statement not for the
-   declaration or other appearances of the string in dump.  */
+/* The call to hot_function should be inlined, while cold_function should
+   not be.  Look for the "cold_function ();" call statement and not for
+   its declaration or other occurrences of the string in the dump.  */
 /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */