public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <fortran@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>,
	Julian Brown <julian@codesourcery.com>, <asolokha@gmx.com>,
	Andrew Pinski <pinskia@gmail.com>
Subject: Add 'c-c++-common/goacc/kernels-decompose-pr104133-1.c' [PR104133]
Date: Fri, 4 Mar 2022 14:34:24 +0100	[thread overview]
Message-ID: <87fsnxon8f.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <87zgm9mxib.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

Hi!

On 2022-03-01T17:46:20+0100, I wrote:
> On 2022-01-13T10:54:16+0100, I wrote:
>> --- a/gcc/omp-oacc-kernels-decompose.cc
>> +++ b/gcc/omp-oacc-kernels-decompose.cc

>> @@ -842,6 +843,9 @@ maybe_build_inner_data_region (location_t loc, gimple *body,
>>         inner_data_clauses = new_clause;
>>
>>         prev_mapped_var = v;
>> +
>> +       /* See <https://gcc.gnu.org/PR100280>.  */
>> +       TREE_ADDRESSABLE (v) = 1;
>>       }
>>      }
>
> So, that's too simple.  ;-) [...]

> We're after gimplification, and must not just set 'TREE_ADDRESSABLE',
> because that may easily violate GIMPLE invariants, leading to ICEs later.
> There are a few open PRs

Pushed to master branch commit e085900fa10e28b684d656b66557d181247a1a48
"Add 'c-c++-common/goacc/kernels-decompose-pr104133-1.c' [PR104133]", see
attached.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-c-c-common-goacc-kernels-decompose-pr104133-1.c-.patch --]
[-- Type: text/x-diff, Size: 2965 bytes --]

From e085900fa10e28b684d656b66557d181247a1a48 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 19 Jan 2022 22:28:55 +0100
Subject: [PATCH] Add 'c-c++-common/goacc/kernels-decompose-pr104133-1.c'
 [PR104133]

..., currently XFAILed with 'dg-ice'.

	PR middle-end/104133
	gcc/testsuite/
	* c-c++-common/goacc/kernels-decompose-pr104133-1.c: New file.
---
 .../goacc/kernels-decompose-pr104133-1.c      | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr104133-1.c

diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr104133-1.c b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr104133-1.c
new file mode 100644
index 00000000000..72dde346dbf
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr104133-1.c
@@ -0,0 +1,40 @@
+/* { dg-additional-options "--param openacc-kernels=decompose" } */
+
+/* { dg-additional-options "-fchecking" }
+   { dg-ice TODO }
+   { dg-prune-output {D\.[0-9]+ = arr_0\.0 \+ k;} }
+   { dg-prune-output {D\.[0-9]+ = arr_0\.1 \+ k;} }
+   { dg-prune-output {during GIMPLE pass: lower} } */
+
+/* { dg-additional-options "-fopt-info-all-omp" } */
+
+/* { dg-additional-options "--param=openacc-privatization=noisy" }
+   Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+   { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */
+
+int arr_0;
+
+void
+foo (void)
+{
+#pragma acc kernels /* { dg-line l_compute1 } */
+  /* { dg-note {variable 'k' declared in block is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute1 } */
+  /* { dg-note {variable 'arr_0\.0' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute1 } */
+  /* { dg-note {variable 'arr_0\.1' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute1 } */
+  {
+    int k;
+
+    /* { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 } */
+#pragma acc loop /* { dg-line l_loop_k1 } */
+    /* { dg-note {variable 'k' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_k1 } */
+    for (k = 0; k < 2; k++)
+      arr_0 += k;
+
+    /* { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 } */
+#pragma acc loop /* { dg-line l_loop_k2 } */
+    /* { dg-note {variable 'k' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_k2 } */
+    for (k = 0; k < 2; k++)
+      arr_0 += k;
+      /* { dg-bogus {error: invalid operands in binary operation} {} { xfail *-*-* } .-1 } */
+  }
+}
-- 
2.34.1


  parent reply	other threads:[~2022-03-04 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190508145157.08beb4df@squid.athome>
2022-01-13  9:54 ` OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280] Thomas Schwinge
2022-03-01 16:46   ` Thomas Schwinge
2022-03-02 13:30     ` Jakub Jelinek
2022-03-04 13:34     ` Add 'c-c++-common/goacc/kernels-decompose-pr104132-1.c' [PR104132] Thomas Schwinge
2022-03-04 13:34     ` Thomas Schwinge [this message]
2022-03-04 13:46     ` OMP lowering: Regimplify 'OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE' DECLs [PR100280, PR104132, PR104133] Thomas Schwinge
2022-03-04 14:57       ` Test 'libgomp.oacc-*/kernels-private-vars-*' with '--param=openacc-kernels=decompose' [PR104784] Thomas Schwinge
2022-03-04 19:52       ` Thomas Schwinge
2022-03-04 13:37   ` Add diagnostic: "note: OpenACC 'kernels' decomposition: variable '[...]' declared in block made addressable" [PR100280] Thomas Schwinge
2022-03-04 13:41   ` OpenACC 'kernels' decomposition: Move 'TREE_ADDRESSABLE' setting into OMP lowering [PR100280] Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsnxon8f.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=asolokha@gmx.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@codesourcery.com \
    --cc=pinskia@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).