re PR fortran/15140 (assertion failed: (TREE_CODE (sym->backend_decl) == PARM_DECL)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Thu, 15 Jul 2004 18:50:17 +0000 (20:50 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Thu, 15 Jul 2004 18:50:17 +0000 (20:50 +0200)
fortran/
PR fortran/15140
* trans-decl.c (gfc_trans_deferred_vars): Remove bogus assertion.

testsuite/
PR fortran/15140
* gfortran.dg/pr15140.f90: New test.

From-SVN: r84770

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr15140.f90 [new file with mode: 0644]

index 2667cb83160beb65f335e139fd97c8d331bb26c4..e69b5de1e205b9720fd561601c83c244bc9d04d8 100644 (file)
@@ -4,6 +4,9 @@
        * trans-decl.c (gfc_build_function_decl): Create a new chardecl
        for every assumed length character dummy argument.
 
+       PR fortran/15140
+       * trans-decl.c (gfc_trans_deferred_vars): Remove bogus assertion.
+       
 2004-07-15  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/15324
index f7cfd9785ca703829544bb957891acb32b19aadc..655c48b1ee6136892e2939cb5df46adb38156e06 100644 (file)
@@ -1728,7 +1728,6 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
              assert (sym->attr.dummy);
 
              /* We should always pass assumed size arrays the g77 way.  */
-             assert (TREE_CODE (sym->backend_decl) == PARM_DECL);
              fnbody = gfc_trans_g77_array (sym, fnbody);
               break;
 
index bab21110c6d0e7870e53140bc02b65c5581b7ebe..ccda3e5333272435d43c2c3b48d431a6ac4a0973 100644 (file)
@@ -6,6 +6,9 @@
        PR fortran/15129
        * gfortran.dg/pr15129.f90: New test.
 
+       PR fortran/15140
+       * gfortran.dg/pr15140.f90: New test.
+
 2004-07-14  Mike Stump  <mrs@apple.com>
 
        * gcc.dg/20020426-2.c: Improve type safety wrt unsignedness.
diff --git a/gcc/testsuite/gfortran.dg/pr15140.f90 b/gcc/testsuite/gfortran.dg/pr15140.f90
new file mode 100644 (file)
index 0000000..393badc
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do run }
+! PR 15140: we used to fail an assertion, because we don't use the
+! argument of the subroutine directly, but instead use a copy of it.
+function M(NAMES)
+  CHARACTER*(*) NAMES(*)
+  if (any(names.ne."asdfg")) call abort
+  m = LEN(NAMES(1))
+END function M
+
+character(5) :: c(2)
+c = "asdfg"
+if(m(c).ne.5) call abort()
+end