Hi!

On Fri, Aug 12, 2022 at 05:40:06PM +0800, Kewen.Lin wrote:
> This patch is to update the NOPs patched before and after
> local entry, it looks like:

As I said before, please don't say NOPs.  I know some documentation
does.  That docvumentation needs fixing.  This is not an acronym or
similar: "nop" is short for "noop" or "no-op", meaning "no operation".
It also is a well-accepted term.  It also is an assembler mnemonic, and
has to be written as all lower case there as well.

Just say "nops" please.

> --- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
> +++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
>  /* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
>  /* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
> +/* { dg-additional-options "-fpatchable-function-entry=3,2" { target 
> powerpc_elfv2 } } */

Add a comment why this is needed?  People looking at this testcase in
the future (including yourself!) will thank you.

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr99888-1.c
> @@ -0,0 +1,45 @@
> +/* { dg-require-effective-target powerpc_elfv2 } */

Does this not work on other PowerPC targets?

> +/* Verify no errors for different NOPs after local entry.  */

(Add "on ELFv2" if you make the test run everywhere :-) )

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr99888-2.c
> @@ -0,0 +1,45 @@
> +/* { dg-require-effective-target powerpc_elfv2 } */
> +
> +/* Verify no errors for 2, 6 and 14 NOPs before local entry.  */

Similar.

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr99888-3.c
> @@ -0,0 +1,12 @@
> +/* { dg-require-effective-target powerpc_elfv2 } */
> +/* { dg-options "-fpatchable-function-entry=1" } */
> +
> +/* Verify no errors, using command line option instead of function
> +   attribute.  */
> +
> +extern int a;
> +
> +int test (int b) {
> +  return a + b;
> +}

And more.

Rest looks good, thanks!


Segher

Reply via email to