This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] PR56477 ICE on pointer assignment checking


Hello,

I'm testing the attached patch which fixes the PR56477 test case.

Will commit as obvious tonight.

Mikael


Attachment: pr56477.CL
Description: Text document

Index: fortran/expr.c
===================================================================
--- fortran/expr.c	(révision 196416)
+++ fortran/expr.c	(copie de travail)
@@ -3732,7 +3732,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_ex
 	  && rvalue->symtree->n.sym->ns->proc_name->attr.flavor != FL_PROCEDURE
 	  && rvalue->symtree->n.sym->ns->proc_name->attr.flavor != FL_PROGRAM)
        for (ns = rvalue->symtree->n.sym->ns;
-	    ns->proc_name && ns->proc_name->attr.flavor != FL_PROCEDURE;
+	    ns && ns->proc_name && ns->proc_name->attr.flavor != FL_PROCEDURE;
 	    ns = ns->parent)
 	if (ns->parent == lvalue->symtree->n.sym->ns)
 	  warn = true;


! { dg-do compile }
!
! PR fortran/56477
! The pointer target live range checking code using to trigger an ICE on
! the following
!
! Contributed by Andrew Benson <abensonca@gmail.com>
!
module s
contains
  function so()
    implicit none
    integer, target  :: so
    integer, pointer :: sp
    sp => so
    return
  end function So
end module s


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]