public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hafiz Abid Qadeer <abidh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-11] Fix an ICE with allocate directive.
Date: Thu, 10 Mar 2022 18:31:32 +0000 (GMT)	[thread overview]
Message-ID: <20220310183132.79DC73858436@sourceware.org> (raw)

https://gcc.gnu.org/g:a03a01959576337cb0cac35de6915cc2b5d9a36c

commit a03a01959576337cb0cac35de6915cc2b5d9a36c
Author: Hafiz Abid Qadeer <abidh@codesourcery.com>
Date:   Wed Mar 9 21:40:45 2022 +0000

    Fix an ICE with allocate directive.
    
    Add case for OMP_CLAUSE_ALLOCATOR in walk_tree_1.  This helps fix
    an ICE which occurs only on OG11 with allocate directive.
    
    Please note that this change is not needed on master.  The code
    there handles all clauses in the same way so a special case for
    OMP_CLAUSE_ALLOCATOR is not required.
    
    gcc/
            * tree.c (walk_tree_1): Add case for OMP_CLAUSE_ALLOCATOR.

Diff:
---
 gcc/ChangeLog.omp |  4 ++++
 gcc/tree.c        | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index c6c60c23480..46143dda9c3 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,7 @@
+2022-03-10  Abid Qadeer  <abidh@codesourcery.com>
+
+	* tree.c (walk_tree_1): Add case for OMP_CLAUSE_ALLOCATOR.
+
 2022-03-09  Abid Qadeer  <abidh@codesourcery.com>
 
 	Backport of a patch posted at
diff --git a/gcc/tree.c b/gcc/tree.c
index 26830f47aa1..1b99620bfcb 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12359,6 +12359,16 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
 	    WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp));
 	  }
 
+	/* This hunk is only needed on og11 as master uses same code
+	   for all clauses.  */
+	case OMP_CLAUSE_ALLOCATOR:
+	  {
+	    int len = omp_clause_num_ops[OMP_CLAUSE_CODE (*tp)];
+	    for (int i = 0; i < len; i++)
+	      WALK_SUBTREE (OMP_CLAUSE_OPERAND (*tp, i));
+	    WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp));
+	  }
+
 	default:
 	  gcc_unreachable ();
 	}


                 reply	other threads:[~2022-03-10 18:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220310183132.79DC73858436@sourceware.org \
    --to=abidh@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).