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

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> What about switch inside of OpenACC constructs?

The standard forbids function static vars in routines. It doesn't forbid
function static vars in OpenACC constructs. That seems inconsistent to me, but
the PGI compiler indeed forbids the first and allows the second. For supporting
function static vars in OpenACC constructs, I've filed PR84992 - "[openacc]
function static var in parallel".

> Is there any reason why function static vars can't be supported, besides
> that the standard says they aren't allowed?

Not that I know of.


[ The rationale I applied here was that it's not a good idea to introduce a
construct in an optimization, if we can't introduce that construct in the
source code. The construct is likely to be rarely triggered and therefore badly
supported. ]

Reply via email to