Go to file
Janus Weil 713485cc67 re PR fortran/39630 ([F03] Procedure Pointer Components)
2009-05-06  Janus Weil  <janus@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/39630
	* decl.c (match_procedure_interface): New function to match the
	interface for a PROCEDURE statement.
	(match_procedure_decl): Call match_procedure_interface.
	(match_ppc_decl): New function to match the declaration of a
	procedure pointer component.
	(gfc_match_procedure):  Call match_ppc_decl.
	(match_binding_attributes): Add new argument 'ppc' and handle the
	POINTER attribute for procedure pointer components.
	(match_procedure_in_type,gfc_match_generic): Added new argument to
	match_binding_attributes.
	* dump-parse-tree.c (show_expr,show_components,show_code_node): Handle
	procedure pointer components.
	* expr.c (free_expr0,gfc_copy_expr,gfc_simplify_expr): Handle EXPR_PPC.
	(gfc_check_pointer_assign): Handle procedure pointer components, but no
	full checking yet.
	(is_proc_ptr_comp): New function to determine if an expression is a
	procedure pointer component.
	* gfortran.h (expr_t): Add EXPR_PPC.
	(symbol_attribute): Add new member 'proc_pointer_comp'.
	(gfc_component): Add new member 'formal'.
	(gfc_exec_op): Add EXEC_CALL_PPC.
	(gfc_get_default_type): Changed first argument.
	(is_proc_ptr_comp): Add prototype.
	(gfc_match_varspec): Add new argument.
	* interface.c (compare_actual_formal): Handle procedure pointer
	components.
	* match.c (gfc_match_pointer_assignment,match_typebound_call): Handle
	procedure pointer components.
	* module.c (mio_expr): Handle EXPR_PPC.
	* parse.c (parse_derived): Handle procedure pointer components.
	* primary.c (gfc_match_varspec): Add new argument 'ppc_arg' and handle
	procedure pointer components.
	(gfc_variable_attr): Handle procedure pointer components.
	(gfc_match_rvalue): Added new argument to gfc_match_varspec and changed
	first argument of gfc_get_default_type.
	(match_variable): Added new argument to gfc_match_varspec.
	* resolve.c (resolve_entries,set_type,resolve_fl_parameter): Changed
	first argument of gfc_get_default_type.
	(resolve_structure_cons,resolve_actual_arglist): Handle procedure
	pointer components.
	(resolve_ppc_call): New function to resolve a call to a procedure
	pointer component (subroutine).
	(resolve_expr_ppc): New function to resolve a call to a procedure
	pointer component (function).
	(gfc_resolve_expr): Handle EXPR_PPC.
	(resolve_code): Handle EXEC_CALL_PPC.
	(resolve_fl_derived): Copy the interface for a procedure pointer
	component.
	(resolve_symbol): Fix overlong line.
	* st.c (gfc_free_statement): Handle EXEC_CALL_PPC.
	* symbol.c (gfc_get_default_type): Changed first argument.
	(gfc_set_default_type): Changed first argument of gfc_get_default_type.
	(gfc_add_component): Initialize ts.type to BT_UNKNOWN.
	* trans.h (gfc_conv_function_call): Renamed.
	* trans.c (gfc_trans_code): Handle EXEC_CALL_PPC.
	* trans-expr.c (gfc_conv_component_ref): Ditto.
	(gfc_conv_function_val): Rename to 'conv_function_val', add new
	argument 'expr' and handle procedure pointer components.
	(gfc_conv_operator_assign): Renamed gfc_conv_function_val.
	(gfc_apply_interface_mapping_to_expr): Handle EXPR_PPC.
	(gfc_conv_function_call): Rename to 'gfc_conv_procedure_call', add new
	argument 'expr' and handle procedure pointer components.
	(gfc_get_proc_ptr_comp): New function to get the backend decl for a
	procedure pointer component.
	(gfc_conv_function_expr): Renamed gfc_conv_function_call.
	(gfc_conv_structure): Handle procedure pointer components.
	* trans-intrinsic.c (gfc_conv_intrinsic_funcall,
	conv_generic_with_optional_char_arg): Renamed gfc_conv_function_call.
	* trans-stmt.h (gfc_get_proc_ptr_comp): Add prototype.
	* trans-stmt.c (gfc_trans_call): Renamed gfc_conv_function_call.
	* trans-types.h (gfc_get_ppc_type): Add prototype.
	* trans-types.c (gfc_get_ppc_type): New function to build a tree node
	for a procedure pointer component.
	(gfc_get_derived_type): Handle procedure pointer components.


2009-05-06  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39630
	* gfortran.dg/proc_decl_1.f90: Modified.
	* gfortran.dg/proc_ptr_comp_1.f90: New.
	* gfortran.dg/proc_ptr_comp_2.f90: New.
	* gfortran.dg/proc_ptr_comp_3.f90: New.
	* gfortran.dg/proc_ptr_comp_4.f90: New.
	* gfortran.dg/proc_ptr_comp_5.f90: New.
	* gfortran.dg/proc_ptr_comp_6.f90: New.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>

From-SVN: r147206
2009-05-06 23:17:16 +02:00
boehm-gc
config
contrib
fixincludes Forgot to ci fixincl.x in previous checkin. 2009-04-28 15:27:28 +00:00
gcc re PR fortran/39630 ([F03] Procedure Pointer Components) 2009-05-06 23:17:16 +02:00
gnattools
include Correct filenames. 2009-04-24 09:47:20 -07:00
INSTALL
intl
libada Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
libcpp
libdecnumber
libffi
libgcc config.gcc: Add soft-fp/t-softfp and i386/t-linux to tmake_file for... 2009-04-17 13:51:19 +02:00
libgfortran
libgomp
libiberty
libjava * testsuite/libjava.jvmti/jvmti-interp.exp 2009-04-28 15:05:56 +00:00
libmudflap Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
libobjc
libssp
libstdc++-v3 re PR libstdc++/39546 (parallel mode doesn't support implicit string conversion) 2009-05-06 11:20:35 +00:00
maintainer-scripts
zlib
ABOUT-NLS intl: New directory; see intl/ChangeLog for details. 2003-07-04 18:18:54 +00:00
ChangeLog * MAINTAINERS: Update my e-mail address. 2009-04-27 12:51:20 -07:00
ChangeLog.tree-ssa
compile compile: Make executable. 2008-02-01 00:06:00 +00:00
config-ml.in
config.guess * config.sub, config.guess: Update from upstream sources. 2009-04-17 21:41:32 +10:00
config.rpath
config.sub * config.sub, config.guess: Update from upstream sources. 2009-04-17 21:41:32 +10:00
configure re PR bootstrap/39739 (Bootstrapping with in-tree mpfr-2.4.1 and --with-gmp=... errors) 2009-04-25 03:24:17 +00:00
configure.ac
COPYING COPYING, [...]: Sync from upstream sources. 2005-07-14 01:08:13 +00:00
COPYING3
COPYING3.LIB COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
COPYING.LIB
COPYING.RUNTIME
depcomp top level: 2005-06-13 08:26:05 +00:00
install-sh COPYING, [...]: Sync from upstream sources. 2005-07-14 01:08:13 +00:00
libtool-ldflags
libtool.m4
lt~obsolete.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltgcc.m4
ltmain.sh libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltoptions.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltsugar.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltversion.m4
MAINTAINERS * MAINTAINERS: Update my e-mail address. 2009-04-27 12:51:20 -07:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change Import from Autoconf sources: 2005-11-21 13:21:37 +11:00
README * README: Remove version number. 2001-06-13 19:48:09 +01:00
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the file COPYING
for copying permission.  The manuals, and some of the runtime
libraries, are under different terms; see the individual source files
for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs.html for how to report bugs usefully.