This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH][RFC] Add PAREN_EXPR, make flag_associative_math the default for Fortran
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Wed, 02 Jan 2008 21:21:22 +0100
- Subject: Re: [PATCH][RFC] Add PAREN_EXPR, make flag_associative_math the default for Fortran
Richard,
Happy New Year and thanks for the patch.
In my opinion gfortran shall obey the parentheses whatever
the options are. I have applied the patch on Intel Darwin9
and I have a few glitches:
(1) some ICEs on tests such as:
character(len=1) :: string
print *, transfer(((transfer(string,"x",1))), "x")
end
or
! { dg-do compile }
! PR fortran/29403
program p
character(len=10) a, b, c
integer i
i = 1
print ('(I0)'), i
a = '(I0,'
b = 'I2,'
c = 'I4)'
call prn(a, b, c, i)
! print (1,*), i ! { dg-error "in PRINT statement" }
end program p
subroutine prn(a, b, c, i)
integer i
character(len=*) a, b, c
print (a//(b//c)), i, i, i
print trim(a//trim(b//c)), i, i, i
end subroutine prn
pr31608_1.f90: In function 'MAIN__':
pr31608_1.f90:1: internal compiler error: in gfc_conv_unary_op, at fortran/trans-expr.c:592
or
print_1_db.f90: In function 'prn':
print_1_db.f90:15: internal compiler error: in gfc_conv_unary_op, at fortran/trans-expr.c:592
(2) "stuff like (x + 1e52) - 1e52" seems to work, but my checking test does not work
as expected and I'll have to investigate in more details.
(3) I have tried to compile the file coming from:
C***********************************************************************
C TEST SUITE FOR VECTORIZING COMPILERS *
C (File 2 of 2) *
C *
C Version: 2.0 *
C Date: 3/14/88 *
C Authors: Original loops from a variety of *
C sources. Collection and synthesis by *
C *
C David Callahan - Tera Computer *
C Jack Dongarra - University of Tennessee *
C David Levine - Argonne National Laboratory *
C***********************************************************************
C Version: 3.0 *
C Date: 1/4/91 *
C Authors: David Levine - Executable version *
C***********************************************************************
...
and the patched gfortran gives an ICE for three subroutines and miss
a few vectorization. One subroutine giving an ICE at -O2 and above is
subroutine s125(ntimes,ld,n,ctime,dtime,a,b,c,d,e,aa,bb,cc)
C
C induction variable recognition
C induction variable in two loops; collapsing possible
C
integer ntimes,ld,n,i,nl,j,k,nn
real a(n),b(n),c(n),d(n),e(n),aa(ld,n),bb(ld,n),cc(ld,n)
real t1,t2,chksum,ctime,dtime,cs1d,array
parameter(nn= 1000)
common/cdata /array(nn*nn)
do j= 1,n
array((j-1)*n+1:j*n)= aa(:n,j)+bb(:n,j)*cc(:n,j)
enddo
return
end
Thanks again for the work
Dominique
PS I think the file I am refering to in (3) comes from
http://softwarecommunity.intel.com/Wiki/HighPerformanceComputing/688.htm