Commit cded7919 by Paul Thomas

[multiple changes]

2015-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68237
	* decl.c (gfc_match_submod_proc): Test the interface symbol
	before accessing its attributes.

2015-11-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66762
	(gfc_get_symbol_decl): Test for attr.used_in_submodule as well
	as attr.use_assoc (twice).
	(gfc_create_module_variable): Ditto.

2015-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68237
	* gfortran.dg/submodule_12.f90: New test

	PR fortran/66762
	* gfortran.dg/submodule_6.f90: Add compile option -flto.

From-SVN: r230661
parent 3be96231
2015-11-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68237
* decl.c (gfc_match_submod_proc): Test the interface symbol
before accessing its attributes.
2015-11-20 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66762
(gfc_get_symbol_decl): Test for attr.used_in_submodule as well
as attr.use_assoc (twice).
(gfc_create_module_variable): Ditto.
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org> 2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/59910 PR fortran/59910
...@@ -7,7 +20,7 @@ ...@@ -7,7 +20,7 @@
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org> 2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/43996 PR fortran/43996
* simplify.c (gfc_simplify_spread): Issue error for too large array * simplify.c (gfc_simplify_spread): Issue error for too large array
constructor in a PARAMETER statement. constructor in a PARAMETER statement.
2015-11-17 Steven G. Kargl <kargl@gcc.gnu.org> 2015-11-17 Steven G. Kargl <kargl@gcc.gnu.org>
......
...@@ -7666,7 +7666,7 @@ gfc_match_submod_proc (void) ...@@ -7666,7 +7666,7 @@ gfc_match_submod_proc (void)
/* Make sure that the result field is appropriately filled, even though /* Make sure that the result field is appropriately filled, even though
the result symbol will be replaced later on. */ the result symbol will be replaced later on. */
if (sym->ts.interface->attr.function) if (sym->ts.interface && sym->ts.interface->attr.function)
{ {
if (sym->ts.interface->result if (sym->ts.interface->result
&& sym->ts.interface->result != sym->ts.interface) && sym->ts.interface->result != sym->ts.interface)
......
...@@ -1497,7 +1497,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -1497,7 +1497,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
declaration. */ declaration. */
if ((sym->attr.flavor == FL_VARIABLE if ((sym->attr.flavor == FL_VARIABLE
|| sym->attr.flavor == FL_PARAMETER) || sym->attr.flavor == FL_PARAMETER)
&& sym->attr.use_assoc && (sym->attr.use_assoc || sym->attr.used_in_submodule)
&& !intrinsic_array_parameter && !intrinsic_array_parameter
&& sym->module && sym->module
&& gfc_get_module_backend_decl (sym)) && gfc_get_module_backend_decl (sym))
...@@ -4499,7 +4499,7 @@ gfc_create_module_variable (gfc_symbol * sym) ...@@ -4499,7 +4499,7 @@ gfc_create_module_variable (gfc_symbol * sym)
decl = sym->backend_decl; decl = sym->backend_decl;
gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE); gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
if (!sym->attr.use_assoc) if (!sym->attr.use_assoc && !sym->attr.used_in_submodule)
{ {
gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
|| TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl); || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
...@@ -4531,7 +4531,8 @@ gfc_create_module_variable (gfc_symbol * sym) ...@@ -4531,7 +4531,8 @@ gfc_create_module_variable (gfc_symbol * sym)
/* Don't generate variables from other modules. Variables from /* Don't generate variables from other modules. Variables from
COMMONs and Cray pointees will already have been generated. */ COMMONs and Cray pointees will already have been generated. */
if (sym->attr.use_assoc || sym->attr.in_common || sym->attr.cray_pointee) if (sym->attr.use_assoc || sym->attr.used_in_submodule
|| sym->attr.in_common || sym->attr.cray_pointee)
return; return;
/* Equivalenced variables arrive here after creation. */ /* Equivalenced variables arrive here after creation. */
......
2015-11-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68237
* gfortran.dg/submodule_12.f90: New test
PR fortran/66762
* gfortran.dg/submodule_6.f90: Add compile option -flto.
2015-11-20 Andre Vieira <andre.simoesdiasvieira@arm.com> 2015-11-20 Andre Vieira <andre.simoesdiasvieira@arm.com>
* lib/target-supports.exp * lib/target-supports.exp
......
! { dg-do compile }
!
! Test the fix for PR68237 in which 'foo' caused a seg fault rather than an error.
!
! Contributed by Martin Reinecke <martin@mpa-garching.mpg.de>
!
module m1
interface
module subroutine bar
end subroutine
end interface
end module m1
submodule (m1) m2
contains
module procedure foo ! { dg-error "must be in a generic module interface" }
end procedure ! { dg-error "Expecting END SUBMODULE statement" }
end submodule
! { dg-do run } ! { dg-do run }
! { dg-options "-flto" }
! !
! Checks that the results of module procedures have the correct characteristics. ! Checks that the results of module procedures have the correct characteristics
! and that submodules use the module version of vtables (PR66762). This latter
! requires the -flto compile option.
! !
! Contributed by Reinhold Bader <reinhold.bader@lrz.de> ! Contributed by Reinhold Bader <reinhold.bader@lrz.de>
! !
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment