From a96c809a699c265144064b9e0e4fee2aea608c44 Mon Sep 17 00:00:00 2001 From: tkoenig Date: Sun, 14 Feb 2016 15:13:39 +0000 Subject: [PATCH] 2016-02-14 Thomas Koenig PR fortran/60526 PR bootstrap/69816 * decl.c (build_sym): Reverted previous patch. 2016-02-14 Thomas Koenig PR fortran/60526 PR bootstrap/69816 * gfortran.dg/type_decl_4.f90: Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233411 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 20 -------------------- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/type_decl_4.f90 | 7 ------- 4 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 gcc/testsuite/gfortran.dg/type_decl_4.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5ef62ae57e3..aa4a0288ee0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,12 @@ 2016-02-14 Thomas Koenig PR fortran/60526 + PR bootstrap/69816 + * decl.c (build_sym): Reverted previous patch. + +2016-02-14 Thomas Koenig + + PR fortran/60526 * decl.c (build_sym): If the name has already been defined as a type, issue error and return false. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a31ea490bcf..df813697a02 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1215,30 +1215,10 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred, { symbol_attribute attr; gfc_symbol *sym; - int nlen; - char u_name[GFC_MAX_SYMBOL_LEN + 1]; - gfc_symtree *st; if (gfc_get_symbol (name, NULL, &sym)) return false; - /* Check if the name has already been defined as a type. The - first letter of the symtree will be in upper case then. */ - - nlen = strlen(name); - gcc_assert (nlen <= GFC_MAX_SYMBOL_LEN); - strncpy (u_name, name, nlen + 1); - u_name[0] = TOUPPER(u_name[0]); - - st = gfc_find_symtree (gfc_current_ns->sym_root, u_name); - - if (st != 0) - { - gfc_error ("Symbol %qs at %C also declared as a type at %L", name, - &st->n.sym->declared_at); - return false; - } - /* Start updating the symbol table. Add basic type attribute if present. */ if (current_ts.type != BT_UNKNOWN && (sym->attr.implicit_type == 0 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b494b13717..cc9e0026482 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,12 @@ 2016-02-14 Thomas Koenig PR fortran/60526 + PR bootstrap/69816 + * gfortran.dg/type_decl_4.f90: Removed. + +2016-02-14 Thomas Koenig + + PR fortran/60526 * gfortran.dg/type_decl_4.f90: New test. 2016-02-14 Alan Modra diff --git a/gcc/testsuite/gfortran.dg/type_decl_4.f90 b/gcc/testsuite/gfortran.dg/type_decl_4.f90 deleted file mode 100644 index 5c3ddb88e56..00000000000 --- a/gcc/testsuite/gfortran.dg/type_decl_4.f90 +++ /dev/null @@ -1,7 +0,0 @@ -! { dg-do compile } -program main - type Xx ! { dg-error "Symbol 'xx' at .1. also declared as a type at .2." } - end type Xx - real :: Xx ! { dg-error "Symbol 'xx' at .1. also declared as a type at .2." } - -end program main -- 2.11.4.GIT