Bug 15481 - [meta-bugs] frontend adds superfluous symbols to namespaces
Summary: [meta-bugs] frontend adds superfluous symbols to namespaces
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: meta-bug, patch
Depends on:
Blocks: 11840 13249 13372 13575 15493 15978
  Show dependency treegraph
 
Reported: 2004-05-16 21:41 UTC by Tobias Schlüter
Modified: 2004-07-10 15:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-05-16 21:45:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Schlüter 2004-05-16 21:41:47 UTC
This is an issue in PR 13575, PR 13372 and PR 13249. In comment #6 of PR 13575,
I outline the problem in more detail and propose a workaround.
Comment 1 Andrew Pinski 2004-05-16 21:45:03 UTC
Confirmed.
Comment 2 Paul Brook 2004-06-08 23:25:25 UTC
Also PR13249 
Comment 3 Tobias Schlüter 2004-06-09 12:59:48 UTC
A workaround for PR13372 is now in place. It should be changed to an error,
instead of gracefully ignoring the issue, once this is fixed. The affected code
can be found in the commit messages from PR13372.
Comment 4 Tobias Schlüter 2004-06-09 13:10:18 UTC
Same as (In reply to comment #3)
> A workaround for PR13372 is now in place. It should be changed to an error,
> instead of gracefully ignoring the issue, once this is fixed. The affected code
> can be found in the commit messages from PR13372.
Similar for PR13249
Comment 5 Tobias Schlüter 2004-06-26 15:46:00 UTC
This patch moves the names of common blocks to a separate symtree, taking us
halfway (conceptually, I fear that much more code will be involved in the rest):
http://gcc.gnu.org/ml/fortran/2004-06/msg00257.html
Comment 6 GCC Commits 2004-06-29 18:56:51 UTC
Subject: Bug 15481

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-06-29 18:56:47

Modified files:
	gcc/fortran    : decl.c dump-parse-tree.c gfortran.h match.c 
	                 match.h module.c parse.c symbol.c 
	                 trans-common.c trans-decl.c 

Log message:
	2004-06-29  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
	Andrew Vaught  <andyv@firstinter.net>
	
	PR fortran/13249
	PR fortran/15481
	* declc (gfc_match_save): Adapt to new common structures,
	don't allow saving USE-associated common.
	* dump-parse-tree (gfc_show_attr): (saved_)common are not
	symbol attributes any longer.
	(gfc_show_symbol): Don't show old-style commons any longer.
	(gfc_show_namespace): Adapt call to gfc_traverse_symtree to new
	interface.
	* gfortran.h (symbol_attribute): Remove common and saved_common
	attributes.
	(gfc_symbol): Remove common_head element.
	(gfc_common_head): New struct.
	(gfc_get_common_head): New macro.
	(gfc_symtree): Add field 'common' to union.
	(gfc_namespace): Add field 'common_root'; change type of field
	'blank_common' to blank_common.
	(gfc_add_data): New prototype.
	(gfc_traverse_symtree): Expect a symtree as first argument
	instead of namespace.
	* match.c (gfc_get_common): New function.
	(match_common_name): Change to take char * as argument, adapt,
	fix bug with empty name.
	(gfc_match_common): Adapt to new data structures. Disallow
	redeclaration of USE-associated COMMON-block. Fix bug with
	empty common.
	(var_element): Adapt to new common structures.
	* match.h (gfc_get_common): Declare.
	* module.c: Add 2004 to copyright years, add commons to module
	file layout description.
	(ab_attribute, attr_bits, mio_symbol_attributes): Remove code
	for removed attributes.
	(mio_symbol): Adapt to new way of storing common relations.
	(load_commons): New function.
	(read_module): Skip common list on first pass, load_commons at
	second.
	(write_commons): New function.
	(write_module): Call write_commons().
	* symbol.c (gfc_add_saved_comon, gfc_add_common): Remove
	functions related to removed attributes.
	(gfc_add_data): New function.
	(gfc_clear_attr): Don't set removed attributes.
	(gfc_copy_attr): Don't copy removed attributes.
	(traverse_symtree): Remove.
	(gfc_traverse_symtree): Don't traverse symbol
	tree of the passed namespace, but require a symtree to be passed
	instead. Unify with traverse_symtree.
	(gfc_traverse_ns): Call gfc_traverse_symtree according to new
	interface.
	(save_symbol): Remove setting of removed attribute.
	* trans-common.c (gfc_sym_mangled_common_id): Change to
	take 'char *' argument instead of 'gfc_symbol'.
	(build_common_decl, new_segment, translate_common): Adapt to new
	data structures, add new
	argument name.
	(create_common): Adapt to new data structures, add new
	argument name. Fix typo in intialization of derived types.
	(finish_equivalences): Add second argument in call to
	create_common.
	(named_common): take 'gfc_symtree' instead of 'gfc_symbol'.
	(gfc_trans_common): Adapt to new data structures.
	* trans-decl.c (gfc_create_module_variables): Also output
	symbols from commons.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&r1=1.11&r2=1.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/dump-parse-tree.c.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.14&r2=1.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.h.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/module.c.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/parse.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-common.c.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.14&r2=1.15

Comment 7 GCC Commits 2004-06-29 18:57:29 UTC
Subject: Bug 15481

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-06-29 18:57:25

Modified files:
	gcc/fortran    : ChangeLog 

Log message:
	2004-06-29  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
	Andrew Vaught  <andyv@firstinter.net>
	
	PR fortran/13249
	PR fortran/15481
	* declc (gfc_match_save): Adapt to new common structures,
	don't allow saving USE-associated common.
	* dump-parse-tree (gfc_show_attr): (saved_)common are not
	symbol attributes any longer.
	(gfc_show_symbol): Don't show old-style commons any longer.
	(gfc_show_namespace): Adapt call to gfc_traverse_symtree to new
	interface.
	* gfortran.h (symbol_attribute): Remove common and saved_common
	attributes.
	(gfc_symbol): Remove common_head element.
	(gfc_common_head): New struct.
	(gfc_get_common_head): New macro.
	(gfc_symtree): Add field 'common' to union.
	(gfc_namespace): Add field 'common_root'; change type of field
	'blank_common' to blank_common.
	(gfc_add_data): New prototype.
	(gfc_traverse_symtree): Expect a symtree as first argument
	instead of namespace.
	* match.c (gfc_get_common): New function.
	(match_common_name): Change to take char * as argument, adapt,
	fix bug with empty name.
	(gfc_match_common): Adapt to new data structures. Disallow
	redeclaration of USE-associated COMMON-block. Fix bug with
	empty common.
	(var_element): Adapt to new common structures.
	* match.h (gfc_get_common): Declare.
	* module.c: Add 2004 to copyright years, add commons to module
	file layout description.
	(ab_attribute, attr_bits, mio_symbol_attributes): Remove code
	for removed attributes.
	(mio_symbol): Adapt to new way of storing common relations.
	(load_commons): New function.
	(read_module): Skip common list on first pass, load_commons at
	second.
	(write_commons): New function.
	(write_module): Call write_commons().
	* symbol.c (gfc_add_saved_comon, gfc_add_common): Remove
	functions related to removed attributes.
	(gfc_add_data): New function.
	(gfc_clear_attr): Don't set removed attributes.
	(gfc_copy_attr): Don't copy removed attributes.
	(traverse_symtree): Remove.
	(gfc_traverse_symtree): Don't traverse symbol
	tree of the passed namespace, but require a symtree to be passed
	instead. Unify with traverse_symtree.
	(gfc_traverse_ns): Call gfc_traverse_symtree according to new
	interface.
	(save_symbol): Remove setting of removed attribute.
	* trans-common.c (gfc_sym_mangled_common_id): Change to
	take 'char *' argument instead of 'gfc_symbol'.
	(build_common_decl, new_segment, translate_common): Adapt to new
	data structures, add new
	argument name.
	(create_common): Adapt to new data structures, add new
	argument name. Fix typo in intialization of derived types.
	(finish_equivalences): Add second argument in call to
	create_common.
	(named_common): take 'gfc_symtree' instead of 'gfc_symbol'.
	(gfc_trans_common): Adapt to new data structures.
	* trans-decl.c (gfc_create_module_variables): Also output
	symbols from commons.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.89&r2=1.90

Comment 8 Tobias Schlüter 2004-07-09 14:27:20 UTC
Patch here: http://gcc.gnu.org/ml/fortran/2004-07/msg00062.html
Comment 9 GCC Commits 2004-07-09 14:53:58 UTC
Subject: Bug 15481

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-07-09 14:53:45

Modified files:
	gcc/fortran    : module.c primary.c resolve.c trans-decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.fortran-torture/compile: implicit_2.f90 

Log message:
	fortran/
	2004-07-09  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
	
	PR fortran/15481
	PR fortran/13372
	PR fortran/13575
	PR fortran/15978
	* module.c (write_symbol, write_symtree): Remove workaround.
	* primary.c (match_actual_arglist): Enhance comment.
	(gfc_match_rvalue): Handle function call with first argument
	a keyword argument correctly.
	* resolve.c (resolve_symbol): Change call to
	gfc_set_default_type to issue error if no implicit type
	can be found.
	* trans-decl.c (gfc_create_module_variable): Remove workaround.
	
	testsuite/
	PR fortran/15481
	PR fortran/13372
	PR fortran/13575
	PR fortran/15978
	* gfortran.fortran-torture/compile/implicit_2.f90: New test.
	
	Also fixed David Billinghursts ChangeLog entry to use GMT

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/module.c.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/primary.c.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.18&r2=1.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3964&r2=1.3965
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/compile/implicit_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 10 GCC Commits 2004-07-09 14:54:48 UTC
Subject: Bug 15481

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-07-09 14:54:44

Modified files:
	gcc/fortran    : ChangeLog 

Log message:
	fortran/
	2004-07-09  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
	
	PR fortran/15481
	PR fortran/13372
	PR fortran/13575
	PR fortran/15978
	* module.c (write_symbol, write_symtree): Remove workaround.
	* primary.c (match_actual_arglist): Enhance comment.
	(gfc_match_rvalue): Handle function call with first argument
	a keyword argument correctly.
	* resolve.c (resolve_symbol): Change call to
	gfc_set_default_type to issue error if no implicit type
	can be found.
	* trans-decl.c (gfc_create_module_variable): Remove workaround.
	
	Add missing ChangeLog

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.103&r2=1.104

Comment 11 Tobias Schlüter 2004-07-09 14:56:24 UTC
Fixed.
Comment 12 GCC Commits 2004-07-10 22:31:22 UTC
Subject: Bug 15481

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-07-10 22:31:19

Modified files:
	gcc/fortran    : ChangeLog trans-decl.c 

Log message:
	* trans-decl.c (generate_local_decl): Remove workaround obsoleted
	by fix for PR 15481.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.112&r2=1.113
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.19&r2=1.20