2009-04-24 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Apr 2009 08:34:14 +0000 (08:34 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Apr 2009 08:34:14 +0000 (08:34 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146677 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/intrinsic_1.f90 [new file with mode: 0644]

index 2932af3..6af8cbe 100644 (file)
@@ -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.
index 72b0684..6aa63be 100644 (file)
@@ -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
index 3af0f6f..9f18666 100644 (file)
@@ -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 (file)
index 0000000..b2413de
--- /dev/null
@@ -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" } }
+