public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/94120] New: [OpenACC] ICE in gimplify_adjust_omp_clauses_1 for 'declare' for variable outside scope
@ 2020-03-10 11:47 burnus at gcc dot gnu.org
  2020-03-10 12:11 ` [Bug middle-end/94120] " marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-03-10 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94120
           Summary: [OpenACC] ICE in gimplify_adjust_omp_clauses_1 for
                    'declare' for variable outside scope
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, openacc
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

The following code gives an ICE; I believe it is invalid as:

"A declare directive must be in the same scope as the declaration of any var
that appears in the data clauses of the directive."


void
f_data (void)
{
  int B[10];
#pragma acc data
  {
# pragma acc declare copy(B)
    for (int i = 0; i < 10; i++)
      B[i] = -i;
  }
}

In gimplify_adjust_omp_clauses_1, flags = n->value == 1 (= GOVD_SEEN) and
gimplify_omp_ctxp->region_type == ORT_ACC_DATA. – As the value is seen but
nothing else matches, one runs into gcc_unreachable (in line 10123).

EXPECTED:
(a) no ICE :-)
(b) an error as the scope is different!

 * * *

Actually, I expect such an error for 'declare' in general (for C/C++/Fortran).

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-20 10:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 11:47 [Bug middle-end/94120] New: [OpenACC] ICE in gimplify_adjust_omp_clauses_1 for 'declare' for variable outside scope burnus at gcc dot gnu.org
2020-03-10 12:11 ` [Bug middle-end/94120] " marxin at gcc dot gnu.org
2020-03-10 14:21 ` burnus at gcc dot gnu.org
2020-03-10 17:22 ` burnus at gcc dot gnu.org
2020-03-11 13:31 ` burnus at gcc dot gnu.org
2020-03-12 10:47 ` burnus at gcc dot gnu.org
2020-04-08  7:40 ` cvs-commit at gcc dot gnu.org
2020-04-08  7:48 ` burnus at gcc dot gnu.org
2020-04-08 17:56 ` cvs-commit at gcc dot gnu.org
2020-04-20 10:42 ` cvs-commit at gcc dot gnu.org

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).