From: Tobias Schlüter Date: Thu, 15 Jul 2004 18:50:17 +0000 (+0200) Subject: re PR fortran/15140 (assertion failed: (TREE_CODE (sym->backend_decl) == PARM_DECL) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5a419530e095f316911d63e6c2eb0008b10d160;p=gcc.git re PR fortran/15140 (assertion failed: (TREE_CODE (sym->backend_decl) == PARM_DECL) 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2667cb83160..e69b5de1e20 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 PR fortran/15324 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index f7cfd9785ca..655c48b1ee6 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bab21110c6d..ccda3e53332 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 * 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 index 00000000000..393badcd4ea --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr15140.f90 @@ -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