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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Close as FIXED - based on

* my previous comment (comment 4)
* based on the following:

(In reply to Jakub Jelinek from comment #2)
> WIP patch.  Clearly still more work is needed, apparently pointer iterators
> in non-rectangular loops are rejected, like:
(example that is committed as part of PR106449)

> and enabling it result in ICEs during omp-expand.c.  Furthermore, for both
> pointer and random access iterator non-rect loops,
I think we cannot really use non-rectangular loops with random-access
iterators. 

It works fine as long as the outer and the inner loop access different
variables, an example for this is libgomp.c++/collapse-2.C → 
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgomp/testsuite/libgomp.c++/collapse-2.C;hb=HEAD

But I currently see no way to use in the outer loop
* a C++ iterator
* a range-based for loop
* a C-style index-variable loop
and then to use 'outer' in any way, except of having yet another classic
C-style loop.
Everything else I came up ends up using an expression involving the outer
iteration variable and not the bare variable. But that's rejected ("expression
refers to iteration variable" error).

> I should verify we only
> allow the var-outer, var-outer + a2, a2 + var-outer and var-outer - a2 forms
> and no others and test code generation.

I believe that's what r12-4733-g2084b5f42a4432da8b0625f9c669bf690ec46468 does
in c-c++-common/gomp/loop-9.c →
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/c-c++-common/gomp/loop-9.c;hb=HEAD

(Admittedly only for "initializer expression" and not for "condition
expression" or "increment expression", but I can confirm that at last the
condition error works.)

Reply via email to