since b is an allocatable without the target attribute, there is no way it can
'alias' a. No need for a temp thus

SUBROUTINE S(a)
INTEGER, POINTER, DIMENSION(:) :: a
INTEGER, DIMENSION(:), ALLOCATABLE :: b
ALLOCATE(b(10))
b(a)=1
END SUBROUTINE S

gfortran -c -Warray-temporaries test.f90
test.f90:5.2:

b(a)=1
 1
Warning: Creating array temporary at (1)


-- 
           Summary: unneeded temporary
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk
OtherBugsDependingO 36854
             nThis:


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

Reply via email to