https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119541

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
In the failing case, the assumption ninteorp <= nappend_args is violated.

While this is diagnosed ...

gcc/testsuite/c-c++-common/gomp/dispatch-11.c:86:31:
error: number of list items in ‘interop’ clause (2) exceeds the number of
‘append_args’ items (1) for ‘declare variant’ candidate ‘repl3’

... the code below is still processed, causing the out of bounds for:

      tree *buffer = XALLOCAVEC (tree, nargs + nappend);
...
      int j = ninterop;
      for (tree t = dispatch_interop; t; t = TREE_CHAIN (t))
        if (OMP_CLAUSE_CODE (t) == OMP_CLAUSE_INTEROP)
          buffer[i + --j] = OMP_CLAUSE_DECL (t);

Reply via email to