From: Tobias Schlüter Date: Wed, 9 Jun 2004 12:55:50 +0000 (+0200) Subject: re PR fortran/13372 (ICE in trans-types.c (gfc_typenode_for_spec), see #13201) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62f1d4705d0b042e13faad97ea12b665b4f3ad84;p=gcc.git re PR fortran/13372 (ICE in trans-types.c (gfc_typenode_for_spec), see #13201) fortran/ PR fortran/13372 * module.c (write_symbol, write_symtree): Don't write symbols wrongly added to namespace. * trans-decl.c (gfc_create_module_variable): Don't create a backend decl for a symbol incorrectly added to namespace. testsuite/ PR fortran/13372 * gfortran.fortran-torture/compile/named_args_2.f90: New test. From-SVN: r82834 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9034b9564c8..d8a6da42f98 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2004-06-09 Tobias Schlueter + + PR fortran/13372 + * module.c (write_symbol, write_symtree): Don't write symbols + wrongly added to namespace. + * trans-decl.c (gfc_create_module_variable): Don't create a + backend decl for a symbol incorrectly added to namespace. + 2004-06-09 Tobias Schlueter PR fortran/13201 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 09f945292aa..eace654810a 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3137,6 +3137,13 @@ write_symbol (int n, gfc_symbol * sym) if (sym->attr.flavor == FL_UNKNOWN || sym->attr.flavor == FL_LABEL) gfc_internal_error ("write_symbol(): bad module symbol '%s'", sym->name); + + if (sym->attr.flavor == FL_VARIABLE && sym->ts.type == BT_UNKNOWN) + /* TODO: this is a workaround for some of the problems in PR15481, + and fixes the dependent bug PR13372. In an ideal frontend, this + should never happen. */ + return; + mio_integer (&n); mio_internal_string (sym->name); @@ -3260,6 +3267,12 @@ write_symtree (gfc_symtree * st) && !sym->attr.subroutine && !sym->attr.function)) return; + if (sym->attr.flavor == FL_VARIABLE && sym->ts.type == BT_UNKNOWN) + /* TODO: this is a workaround for some of the problems in PR15481, + and fixes the dependent bug PR13372. In an ideal frontend, this + should never happen. */ + return; + if (check_unique_name (st->name)) return; diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 7bd912e7515..14207378e0f 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1788,6 +1788,12 @@ gfc_create_module_variable (gfc_symbol * sym) && (sym->attr.flavor != FL_PARAMETER || sym->attr.dimension == 0)) return; + if (sym->attr.flavor == FL_VARIABLE && sym->ts.type == BT_UNKNOWN) + /* TODO: This is a workaround for the issue outlined in PR 15481, + and it fixes the bug in PR13372. This should never happen in an + ideal frontend. */ + return; + /* Don't generate variables from other modules. */ if (sym->attr.use_assoc) return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d726cf08f69..d60039b8607 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,10 +1,15 @@ +2004-06-09 Tobias Schlueter + + PR fortran/13372 + * gfortran.fortran-torture/compile/named_args_2.f90: New test. + 2004-06-09 Bud Davis PR gfortran/14897 - * gfortran.fortran-torture/execute/t_edit.f90 + * gfortran.fortran-torture/execute/t_edit.f90: New test. 2004-06-09 Bud Davis - + PR gfortran/15755 * gfortran.fortran-torture/execute/backspace.c : New test. diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/named_args_2.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/named_args_2.f90 new file mode 100644 index 00000000000..c2d36eb5848 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/named_args_2.f90 @@ -0,0 +1,8 @@ +! this is the reduced testcase from pr13372 +! we wrongly add a symbol "P" to the module +! Currently (2004/06/09) a workaround is in place +! PR 15481 tracks any steps towards a real fix. +module typeSizes +implicit none + integer, parameter :: FourByteReal = selected_real_kind(P = 6, R = 37) +end module typeSizes