]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix an ICE with allocate directive.
authorHafiz Abid Qadeer <abidh@codesourcery.com>
Wed, 9 Mar 2022 21:40:45 +0000 (21:40 +0000)
committerHafiz Abid Qadeer <abidh@codesourcery.com>
Thu, 10 Mar 2022 13:51:24 +0000 (13:51 +0000)
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.

gcc/ChangeLog.omp
gcc/tree.c

index c6c60c23480eadf7f4ca1ae8fdccc27eeb386744..46143dda9c3f736e25b4d8ef601210b97a5a387b 100644 (file)
@@ -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
index 26830f47aa1b6a9593c487b802e486d0cf0916c6..1b99620bfcbdcfe8da581cc3e42e5d3e313ea625 100644 (file)
@@ -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 ();
        }