This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33341] array temporaries for array constructors (unnecessary stores)



------- Comment #3 from dfranke at gcc dot gnu dot org  2009-01-03 21:39 -------
Not specific to the ALL intrinsic.

$> cat ctor.f90
  INTEGER :: i, n, a(5)
  n = 5
  a = (/ (i, i = 1, n) /)
END

$> gfortran-svn -Warray-temporaries ctor.f90
ctor.f90:3.9:

  a = (/ (i, i = 1, n) /)
         1
Warning: Creating array temporary at (1)

If N is not a variable, the simplifier takes over and no runtime construction
of arrays is necessary. Not applicable example in #0, of course.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
            Summary|array temporaries for "all  |array temporaries for array
                   |intrinsic" (unnecessary     |constructors (unnecessary
                   |stores for array            |stores)
                   |constructor)                |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33341


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]