public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: Re: [Patch] Fortran: Support OpenMP's 'allocate' directive for stack vars
Date: Fri, 13 Oct 2023 13:01:17 +0200	[thread overview]
Message-ID: <ZSkjfRUgptMNyOAw@tucnak> (raw)
In-Reply-To: <457ea120-5cca-48e0-89d6-c3eab4234b61@codesourcery.com>

On Tue, Oct 10, 2023 at 06:46:35PM +0200, Tobias Burnus wrote:
> 	* parse.cc (check_omp_allocate_stmt): Permit procedure pointers
> 	here (rejected later) for less mislreading diagnostic.

s/misl/mis/

> libgomp/ChangeLog:
> 
> 	* libgomp.texi:

Fill in something here.

> @@ -7220,8 +7227,7 @@ gfc_resolve_omp_allocate (gfc_namespace *ns, gfc_omp_namelist *list)
>  		     &n->where);
>  	  continue;
>  	}
> -      if (ns != n->sym->ns || n->sym->attr.use_assoc
> -	  || n->sym->attr.host_assoc || n->sym->attr.imported)
> +      if (ns != n->sym->ns || n->sym->attr.use_assoc ||  n->sym->attr.imported)

s/  n/ n/

> --- a/gcc/gimplify.cc
> +++ b/gcc/gimplify.cc
> @@ -1400,23 +1400,53 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
>  			  "region must specify an %<allocator%> clause", t);
>  	      /* Skip for omp_default_mem_alloc (= 1),
>  		 unless align is present. */
> -	      else if (!errorcount
> -		       && (align != NULL_TREE
> -			   || alloc == NULL_TREE
> -			   || !integer_onep (alloc)))
> +	      else if (errorcount
> +		       || (align == NULL_TREE
> +			   && alloc != NULL_TREE
> +			   && integer_onep (alloc)))
> +		DECL_ATTRIBUTES (t) = remove_attribute ("omp allocate",
> +							DECL_ATTRIBUTES (t));

Probably already preexisting, by I wonder how safe remove_attribute is.
Aren't attributes shared in some cases
(like __attribute__((attr1, attr2, attr3)) int a, b, c, d;)?
Not really sure if something unshares them afterwards.
If they are shared, adding new attributes is fine, that will make the new
additions not shared and the tail shared, but remove_attribute could remove
it from all of them at once.  Perhaps I'm wrong, haven't verified.

Otherwise LGTM (though, I didn't spot anything about allocatables in the
patch, am I just looking wrong or are they still unsupported)?

	Jakub


  reply	other threads:[~2023-10-13 11:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 16:46 Tobias Burnus
2023-10-13 11:01 ` Jakub Jelinek [this message]
2023-10-13 13:29   ` Tobias Burnus
2023-10-18  9:12     ` Thomas Schwinge
2023-10-18  9:36       ` Jakub Jelinek
2023-10-18 10:56         ` [Patch] OpenMP: Avoid ICE with LTO and 'omp allocate (was: [Patch] Fortran: Support OpenMP's 'allocate' directive for stack vars) Tobias Burnus
2023-10-18 11:01           ` 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=ZSkjfRUgptMNyOAw@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@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).