Am 15.10.2011 14:04, schrieb Thomas Koenig:
Am 15.10.2011 13:36, schrieb Jakub Jelinek:
This looks wrong. Threadprivate variables aren't completely cheap,
much better would be an automatic variable instead.
As Fortran FE IL doesn't have block local variables, I guess you want
to create the var at function scope and add a private(that_temporary)
clause to the nearest enclosing OpenMP directive.
Actually, Fortran does have BLOCK local variables,
(Those were added with Fortran 2008 and in GCC 4.5)
which I used in the first place. This caused the ICE with workshare,
because BLOCK
is not supported for workshare.
I'll work on your suggestion, though.
I think that's the wrong solution to the problem: I think it makes more
sense to fix the handling for OMP workshare to handle BLOCK correctly
rather than to move the variable to the function scope and then to
fiddle with the private attribute. (By the way, an interesting question
would be how the next [4.0] (or a next) OpenMP version will handle
Fortran 2003 and 2008 features.)
Tobias