aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-05-20 15:08:38 +0200
committerThomas Schwinge <thomas@codesourcery.com>2021-05-21 19:59:44 +0200
commitf6f45309d9fc140006886456b291e4ac24812cea (patch)
tree51f360811a001a1fca00c249588a263b3de207e3 /gcc
parent29a2f51806c5b30e17a8d0e9ba7915a3c53c34ff (diff)
downloadgcc-f6f45309d9fc140006886456b291e4ac24812cea.zip
gcc-f6f45309d9fc140006886456b291e4ac24812cea.tar.gz
gcc-f6f45309d9fc140006886456b291e4ac24812cea.tar.bz2
[OpenACC privatization, nvptx] Tighten some aspects [PR90115]
No functional change. gcc/ PR middle-end/90115 * config/nvptx/nvptx.c (nvptx_goacc_adjust_private_decl) (nvptx_goacc_expand_var_decl): Tighten.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/nvptx/nvptx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 80116e5..60d3f07 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -6682,12 +6682,12 @@ nvptx_truly_noop_truncation (poly_uint64, poly_uint64)
static tree
nvptx_goacc_adjust_private_decl (tree decl, int level)
{
- if (level != GOMP_DIM_GANG)
- return decl;
+ gcc_checking_assert (!lookup_attribute ("oacc gang-private",
+ DECL_ATTRIBUTES (decl)));
/* Set "oacc gang-private" attribute for gang-private variable
declarations. */
- if (!lookup_attribute ("oacc gang-private", DECL_ATTRIBUTES (decl)))
+ if (level == GOMP_DIM_GANG)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -6708,9 +6708,10 @@ static rtx
nvptx_goacc_expand_var_decl (tree var)
{
/* Place "oacc gang-private" variables in shared memory. */
- if (VAR_P (var)
- && lookup_attribute ("oacc gang-private", DECL_ATTRIBUTES (var)))
+ if (lookup_attribute ("oacc gang-private", DECL_ATTRIBUTES (var)))
{
+ gcc_checking_assert (VAR_P (var));
+
unsigned int offset, *poffset;
poffset = gang_private_shared_hmap.get (var);
if (poffset)