public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH V2 2/5] OpenMP: C front end support for imperfectly-nested loops
Date: Tue, 22 Aug 2023 15:23:42 +0200	[thread overview]
Message-ID: <ZOS23tuDLb9VEOpa@tucnak> (raw)
In-Reply-To: <20230723221521.3739463-3-sandra@codesourcery.com>

> New common C/C++ testcases are in a separate patch.
> 
> gcc/c-family/ChangeLog
> 	* c-common.h (c_omp_check_loop_binding_exprs): Declare.
> 	* c-omp.cc: Include tree-iterator.h.
> 	(find_binding_in_body): New.
> 	(check_loop_binding_expr_r): New.
> 	(LOCATION_OR): New.
> 	(check_looop_binding_expr): New.
> 	(c_omp_check_loop_binding_exprs): New.
> 
> gcc/c/ChangeLog
> 	* c-parser.cc (struct c_parser): Add omp_for_parse_state field.
> 	(struct omp_for_parse_data): New.
> 	(check_omp_intervening_code): New.
> 	(add_structured_block_stmt): New.
> 	(c_parser_compound_statement_nostart): Recognize intervening code,
> 	nested loops, and other things that need special handling in
> 	OpenMP loop constructs.
> 	(c_parser_while_statement): Error on loop in intervening code.
> 	(c_parser_do_statement): Likewise.
> 	(c_parser_for_statement): Likewise.
> 	(c_parser_postfix_expression_after_primary): Error on calls to
> 	the OpenMP runtime in intervening code.
> 	(c_parser_pragma): Error on OpenMP pragmas in intervening code.
> 	(c_parser_omp_loop_nest): New.
> 	(c_parser_omp_for_loop): Rewrite to use recursive descent, calling
> 	c_parser_omp_loop_nest to do the heavy lifting.
> 
> gcc/ChangeLog
> 	* omp-api.h: New.
> 	* omp-general.cc (omp_runtime_api_procname): New.
> 	(omp_runtime_api_call): Moved here from omp-low.cc, and make
> 	non-static.
> 	* omp-general.h: Include omp-api.h.
> 	* omp-low.cc (omp_runtime_api_call): Delete this copy.
> 
> gcc/testsuite/ChangeLog
> 	* c-c++-common/goacc/collapse-1.c: Update for new C error behavior.
> 	* c-c++-common/goacc/tile-2.c: Likewise.
> 	* gcc.dg/gomp/collapse-1.c: Likewise.

> diff --git a/gcc/testsuite/c-c++-common/goacc/collapse-1.c b/gcc/testsuite/c-c++-common/goacc/collapse-1.c
> index 11b14383983..0feac8f8ddb 100644
> --- a/gcc/testsuite/c-c++-common/goacc/collapse-1.c
> +++ b/gcc/testsuite/c-c++-common/goacc/collapse-1.c
> @@ -8,8 +8,8 @@ f1 (void)
>  {
>    #pragma acc parallel
>    #pragma acc loop collapse (2)
> -  for (i = 0; i < 5; i++)
> -    ;					/* { dg-error "not enough perfectly nested" } */
> +  for (i = 0; i < 5; i++)	/* { dg-error "not enough nested loops" } */
> +    ;
>    {
>      for (j = 0; j < 5; j++)
>        ;

All these c-c++-common testsuite changes will now FAIL after the C patch but
before the C++.  It is nice to have the new c-c++-common tests in a separate
patch, but these tweaks which can't be just avoided need the temporary
{ target c } vs. { target c++} hacks undone later in the C++ patch.

> --- a/gcc/testsuite/c-c++-common/goacc/tile-2.c
> +++ b/gcc/testsuite/c-c++-common/goacc/tile-2.c
> @@ -3,8 +3,8 @@ int main ()
>  #pragma acc parallel
>    {
>  #pragma acc loop tile (*,*)
> -    for (int ix = 0; ix < 30; ix++)
> -      ; /* { dg-error "not enough" } */
> +    for (int ix = 0; ix < 30; ix++) /* { dg-error "not enough" "" { target c } } */
> +      ; /* { dg-error "not enough" "" { target c++ } } */

E.g. like you do here.

Otherwise LGTM.

	Jakub


  reply	other threads:[~2023-08-22 13:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 22:15 [PATCH V2 0/5] OpenMP: " Sandra Loosemore
2023-07-23 22:15 ` [PATCH V2 1/5] OpenMP: Add OMP_STRUCTURED_BLOCK and GIMPLE_OMP_STRUCTURED_BLOCK Sandra Loosemore
2023-08-22 13:01   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 2/5] OpenMP: C front end support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:23   ` Jakub Jelinek [this message]
2023-08-22 18:53     ` Sandra Loosemore
2023-08-24 11:49       ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 3/5] OpenMP: C++ " Sandra Loosemore
2023-08-22 13:31   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 4/5] OpenMP: New C/C++ testcases for imperfectly nested loops Sandra Loosemore
2023-08-22 13:34   ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 5/5] OpenMP: Fortran support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:37   ` Jakub Jelinek
2023-08-24 16:36     ` Tobias Burnus
2023-08-22 12:56 ` [PATCH V2 0/5] OpenMP: " Jakub Jelinek

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=ZOS23tuDLb9VEOpa@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sandra@codesourcery.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).