diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-04-24 10:34:14 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-04-24 10:34:14 +0200 |
commit | 87526ff17cbea5303516e983886f6cea2d851176 (patch) | |
tree | 8a05766cd1990b96850ccead3898f876692730d4 /gcc | |
parent | e6e15ec950f40f7c1ad74c440d6f46344b69dcb1 (diff) | |
download | gcc-87526ff17cbea5303516e983886f6cea2d851176.zip gcc-87526ff17cbea5303516e983886f6cea2d851176.tar.gz gcc-87526ff17cbea5303516e983886f6cea2d851176.tar.bz2 |
re PR fortran/39861 (ICE with INTRINSIC in module: write_symbol(): bad module symbol)
2009-04-24 Janus Weil <janus@gcc.gnu.org>
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 <janus@gcc.gnu.org>
PR fortran/39861
PR fortran/39864
* gfortran.dg/intrinsic_1.f90: New.
From-SVN: r146677
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/symbol.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/intrinsic_1.f90 | 28 |
4 files changed, 43 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2932af3..6af8cbe 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2009-04-24 Janus Weil <janus@gcc.gnu.org> + + 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 <tglek@mozilla.com> * f95-lang.c: Update GTY annotations to new syntax. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 72b0684..6aa63be 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 3af0f6f..9f18666 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-04-24 Janus Weil <janus@gcc.gnu.org> + + PR fortran/39861 + PR fortran/39864 + * gfortran.dg/intrinsic_1.f90: New. + 2009-04-24 Eric Botcazou <ebotcazou@adacore.com> * 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 0000000..b2413de --- /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 <dominiq@lps.ens.fr> +! and Michael Richmond <michael.a.richmond@nasa.gov>. + +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" } } + |