------- Comment #12 from tkoenig at gcc dot gnu dot org  2010-08-02 22:16 
-------
(In reply to comment #5)

> [macbook] lin/test% gfc -Warray-temporaries nf.f90
> nf.f90:293.30:
> 
>    if ( i>i1 ) x(i:i+nxy-1) = x(i:i+nxy-1) - au3(i-nxy:i-1)*x(i-nxy:i-1)
>                               1
> Warning: Creating array temporary at (1)
> nf.f90:280.21:
> 
>       g(i:i+nxy-1) = g(i:i+nxy-1) - au3(i-nxy:i-1)*g(i-nxy:i-1)
>                      1
> Warning: Creating array temporary at (1)
> nf.f90:261.29:
> 
>    if ( i>i1 ) x(i:i+nx-1) = x(i:i+nx-1) - au2(i-nx:i-1)*x(i-nx:i-1)
>                              1
> Warning: Creating array temporary at (1)
> nf.f90:248.20:
> 
>       g(i:i+nx-1) = g(i:i+nx-1) - au2(i-nx:i-1)*g(i-nx:i-1)
>                     1
> Warning: Creating array temporary at (1)
> 
> i.e., disjoint sections are not spotted.

This vanishes with -m32.

The reason is that we, for some strange reason, convert the upper
bound to the pointer width on a particular platform.  For 64-bit, this
results in

subroutine foo(a,b,i,j,k,n)                           
  implicit none                                       
  integer, intent(in) :: i, j, k, n                   
  real, dimension(n) :: a,b                           
  a(k:i-1) = a(i:j)                                                      
end subroutine foo        

ending up with -fdump-parse-treee as

        ASSIGN foo:a(foo:k:__convert_i4_i8[[(((- foo:i 1)))]])
foo:a(foo:i:__convert_i4_i8[[((foo:j))]])

which confuses gfc_dep_compare_expr, which is too stupid to see through the
type conversion.

I know where to start, but it is late in the evening ;-)


-- 


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

Reply via email to