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

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
The reason is that I want to make creation of temporary
variables for arrays more sane.

Currently, temporary arrays are handled using an allocatable array
variable. This obviously does not work if -fno-realloc-lhs is
specified, and introduces unneeded complexity in the generated
code, which is hard for the middle-end optimizers to remove.

What I want to do is, if I want to create a temporary variable for
an array, is to change

   real, dimension(something,other) :: a

   a(f(x),1:3)

into

   block
     freeze = f(x)
     size_1 = 1;
     size_2 = 3;
       block
          real, dimension(size_1, size_2) :: a_tmp
          a_tmp(:,;) = a(freeze, 1:3)
          ...
       end block
   end block

While this might work in the most simple cases, I don't want
to introduce instability by hitting a bug with too many nesting
levels.

Reply via email to