Hi Kwok!

On 2020-07-22T14:38:04+0100, Kwok Cheung Yeung <k...@codesourcery.com> wrote:
> This test fails due to expected warnings and errors not being emitted by GCC.
> The problem is that the 'gang reduction on an orphan loop' error is caught 
> very
> early on in the frontends (c/c-typeck.c and cp/semantics.c), so the compiler
> aborts before getting to the tree passes that emit the missing 
> warnings/errors.

ACK, and it seems correct to me that these are indeed "gang reduction on
an orphan loop".

> This error handling was introduced by the patch 'Various OpenACC reduction
> enhancements - FE changes' (commit 6b3e1f7f05cd360bbd356b3f78511aa2ec3f40c3),
> but the later patch to fix affected testcases 'Various OpenACC reduction
> enhancements - test cases' (commit 6a0b5806b24bfdefe0b0f3ccbcc51299e5195dca) 
> did
> not include a fix for routine-4-extern.c.
>
> This patch removes the now outdated dg-error and dg-warnings from the test. 
> Okay
> for OG10?

That however completely defeats what we're intending to test here, which
is to "Test invalid intra-routine parallelism".  The same problem has
been introduced in og10 commit 6a0b5806b24bfdefe0b0f3ccbcc51299e5195dca
"Various OpenACC reduction enhancements - test cases" for
'gcc/testsuite/c-c++-common/goacc/routine-4.c', which throughout changed:

    -#pragma acc loop gang reduction (+:red) // { dg-error "disallowed by 
containing routine" }
    +#pragma acc loop seq reduction (+:red)

Please revert that, and instead replace 'reduction (+:red)' with a
different "dummy loop operation" (just an empty loop body?), and in the
commit log state that this should've been included in the respective og10
commit adding the "gang reduction on an orphan loop" checking.


Grüße
 Thomas


> From 5774f048563df311f2a35a654b8c2d7b1af9f2da Mon Sep 17 00:00:00 2001
> From: Kwok Cheung Yeung <k...@codesourcery.com>
> Date: Thu, 18 Jun 2020 14:31:17 -0700
> Subject: [PATCH 2/6] Fix failures in c-c++-common/goacc/routine-4-extern.c
>  testcase
>
> 2020-07-21  Kwok Cheung Yeung  <k...@codesourcery.com>
>
>       gcc/testsuite/
>       * c-c++-common/goacc/routine-4-extern.c (seq, vector, worker): Remove
>       obsolete expected warnings and errors.
> ---
>  gcc/testsuite/c-c++-common/goacc/routine-4-extern.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/testsuite/c-c++-common/goacc/routine-4-extern.c 
> b/gcc/testsuite/c-c++-common/goacc/routine-4-extern.c
> index c23ddcf..5f8372c 100644
> --- a/gcc/testsuite/c-c++-common/goacc/routine-4-extern.c
> +++ b/gcc/testsuite/c-c++-common/goacc/routine-4-extern.c
> @@ -21,14 +21,14 @@ void vector (void);
>  #pragma acc routine seq
>  void seq (void)
>  {
> -  extern_gang ();  /* { dg-error "routine call uses" } */
> -  extern_worker ();  /* { dg-error "routine call uses" } */
> -  extern_vector ();  /* { dg-error "routine call uses" } */
> +  extern_gang ();
> +  extern_worker ();
> +  extern_vector ();
>    extern_seq ();
>
>    int red;
>
> -#pragma acc loop reduction (+:red) // { dg-warning "insufficient 
> partitioning" }
> +#pragma acc loop reduction (+:red)
>    for (int i = 0; i < 10; i++)
>      red ++;
>
> @@ -36,19 +36,19 @@ void seq (void)
>    for (int i = 0; i < 10; i++)
>      red ++;
>
> -#pragma acc loop worker reduction (+:red) // { dg-error "disallowed by 
> containing routine" }
> +#pragma acc loop worker reduction (+:red)
>    for (int i = 0; i < 10; i++)
>      red ++;
>
> -#pragma acc loop vector reduction (+:red) // { dg-error "disallowed by 
> containing routine" }
> +#pragma acc loop vector reduction (+:red)
>    for (int i = 0; i < 10; i++)
>      red ++;
>  }
>
>  void vector (void)
>  {
> -  extern_gang ();  /* { dg-error "routine call uses" } */
> -  extern_worker ();  /* { dg-error "routine call uses" } */
> +  extern_gang ();
> +  extern_worker ();
>    extern_vector ();
>    extern_seq ();
>
> @@ -62,7 +62,7 @@ void vector (void)
>    for (int i = 0; i < 10; i++)
>      red ++;
>
> -#pragma acc loop worker reduction (+:red) // { dg-error "disallowed by 
> containing routine" }
> +#pragma acc loop worker reduction (+:red)
>    for (int i = 0; i < 10; i++)
>      red ++;
>
> @@ -73,7 +73,7 @@ void vector (void)
>
>  void worker (void)
>  {
> -  extern_gang ();  /* { dg-error "routine call uses" } */
> +  extern_gang ();
>    extern_worker ();
>    extern_vector ();
>    extern_seq ();
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter

Reply via email to