Commit c60a84b8 by Paul Thomas

re PR fortran/31214 (User-defined operator using entry leads to ICE)

2007-04-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31214
	* trans-decl.c (gfc_get_symbol_decl): Allow unreferenced use
	associated symbols.

2007-04-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31424
	* gfortran.dg/unreferenced_use_assoc_1.f90: New test.

From-SVN: r123642
parent e9bd9f7d
2007-04-07 Paul Thomas <pault@gcc.gnu.org> 2007-04-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31214
* trans-decl.c (gfc_get_symbol_decl): Allow unreferenced use
associated symbols.
2007-04-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31293 PR fortran/31293
* symbol.c (gfc_check_function_type): New function. * symbol.c (gfc_check_function_type): New function.
* gfortran.h : Add prototype for previous. * gfortran.h : Add prototype for previous.
......
...@@ -873,6 +873,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -873,6 +873,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
int byref; int byref;
gcc_assert (sym->attr.referenced gcc_assert (sym->attr.referenced
|| sym->attr.use_assoc
|| sym->ns->proc_name->attr.if_source == IFSRC_IFBODY); || sym->ns->proc_name->attr.if_source == IFSRC_IFBODY);
if (sym->ns && sym->ns->proc_name->attr.function) if (sym->ns && sym->ns->proc_name->attr.function)
......
2007-04-07 Paul Thomas <pault@gcc.gnu.org> 2007-04-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31424
* gfortran.dg/unreferenced_use_assoc_1.f90: New test.
2007-04-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31293 PR fortran/31293
* gfortran.dg/interface_12.f90: New test. * gfortran.dg/interface_12.f90: New test.
! { dg-do compile }
! Tests the fix for PR31424.
!
module InternalCompilerError
type Byte
private
character(len=1) :: singleByte
end type
type (Byte) :: BytesPrototype(1)
type UserType
real :: r
end type
contains
function UserTypeToBytes(user) result (bytes)
type(UserType) :: user
type(Byte) :: bytes(size(transfer(user, BytesPrototype)))
bytes = transfer(user, BytesPrototype)
end function
subroutine DoSomethingWithBytes(bytes)
type(Byte), intent(in) :: bytes(:)
end subroutine
end module
program main
use InternalCompilerError
type (UserType) :: user
! The following line caused the ICE
call DoSomethingWithBytes( UserTypeToBytes(user) )
end program
! { dg-final { cleanup-modules "InternalCompilerError" } }
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