public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/114020] New: ENTRY and procedure pointer leads to ICE
@ 2024-02-20 20:48 kargl at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: kargl at gcc dot gnu.org @ 2024-02-20 20:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114020

            Bug ID: 114020
           Summary: ENTRY and procedure pointer leads to ICE
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

Found with the Fujitsu testsuite.  Reduced testcase.
Note, if the use of ENTRY is replace with an actual 
function, ie., 'function kmr_fixfun() result(zz)" the
code compiles and executes correctly.

!
! https://github.com/fujitsu/compiler-test-suite
! Reduced from Fortran/0071/0071_0018.f90
!
module xxxf

   contains

   subroutine sub
   end subroutine

   function kmr_fixfun2() result(zz)
      entry kmr_fixfun() result(zz)
      procedure(sub), pointer :: zz
      zz => null()
   end function 

   integer function foo() result(zz)
      procedure(sub), pointer :: fp
      fp => kmr_fixfun()
      zz = 0
    end function foo

end module xxxf

   use xxxf
   if (foo() /= 0) stop
end

% gfcx -o z 0071/0071_0018.f90
0071/0071_0018.f90:8:3:

    8 |    function kmr_fixfun2() result(zz)
      |   ^
internal compiler error: in fold_convert_loc, at fold-const.cc:2633
0x741511 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gccx/gcc/fold-const.cc:2633
0xd650c9 gimplify_modify_expr
        ../../gccx/gcc/gimplify.cc:6356
0xd4e52c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-20 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 20:48 [Bug fortran/114020] New: ENTRY and procedure pointer leads to ICE kargl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).