From: janus Date: Fri, 24 Apr 2009 08:34:14 +0000 (+0000) Subject: 2009-04-24 Janus Weil X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d483863c8f5e6b492eca565da9afd042d0fd72c9;p=thirdparty%2Fgcc.git 2009-04-24 Janus Weil PR fortran/39861 PR fortran/39864 * symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy for the formal arguments. 2009-04-24 Janus Weil PR fortran/39861 PR fortran/39864 * gfortran.dg/intrinsic_1.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146677 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2932af3fdac1..6af8cbe2042a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2009-04-24 Janus Weil + + PR fortran/39861 + PR fortran/39864 + * symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy + for the formal arguments. + 2009-04-21 Taras Glek * f95-lang.c: Update GTY annotations to new syntax. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 72b068407428..6aa63bebabe0 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -3865,6 +3865,8 @@ gfc_copy_formal_args_intr (gfc_symbol *dest, gfc_intrinsic_sym *src) /* May need to copy more info for the symbol. */ formal_arg->sym->ts = curr_arg->ts; formal_arg->sym->attr.optional = curr_arg->optional; + formal_arg->sym->attr.flavor = FL_VARIABLE; + formal_arg->sym->attr.dummy = 1; /* If this isn't the first arg, set up the next ptr. For the last arg built, the formal_arg->next will never get set to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3af0f6f3dde6..9f186666725e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-04-24 Janus Weil + + PR fortran/39861 + PR fortran/39864 + * gfortran.dg/intrinsic_1.f90: New. + 2009-04-24 Eric Botcazou * gnat.dg/alignment7.adb: New test. diff --git a/gcc/testsuite/gfortran.dg/intrinsic_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_1.f90 new file mode 100644 index 000000000000..b2413de1a3f8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_1.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! +! PR 39861/39864 +! +! Test cases provided by Dominique d'Humieres +! and Michael Richmond . + +module vector_calculus + intrinsic :: dot_product, sqrt + +contains + + function len(r) + real, dimension(:), intent(in) :: r + real :: len + len = sqrt(dot_product(r,r)) + end function len + + FUNCTION next_state() + INTRINSIC :: RESHAPE + INTEGER, PARAMETER :: trantb(1,1) = RESHAPE((/1,2/), shape=(/1,1/)) + next_state = trantb(1, 1) + END FUNCTION next_state + +end module vector_calculus + +! { dg-final { cleanup-modules "vector_calculus" } } +