public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53298] New: ICE in gfc_conv_scalarized_array_ref for ARRAY + substring
@ 2012-05-09 17:12 burnus at gcc dot gnu.org
  2013-04-06 11:46 ` [Bug fortran/53298] " tkoenig at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-09 17:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53298

             Bug #: 53298
           Summary: ICE in gfc_conv_scalarized_array_ref for ARRAY +
                    substring
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
            Blocks: 45424


The following program segfaults. The problem is the expression
   array(:)(1:)
           ^^^--<-- substring

This combination is seemingly not handled by gfc_conv_expr_descriptor.

At the end, one gets a segfault for:
  gfc_conv_scalarized_array_ref (se=0x7fffffffcfe0, ar=0x1700538)
      at fortran/trans-array.c:3016
  3016      expr = ss->info->expr;

which is called via gfc_conv_array_ref <<< gfc_conv_variable <<<
gfc_conv_string_length <<< get_array_charlen <<< gfc_conv_expr_descriptor.


  character(len=5) :: str(3)
  call f(str(:))
contains
  subroutine f(x)
   character(len=*) :: x(:)
   logical :: llll
   print *, size(x(:)(1:))
  end subroutine f
end


The program compiles flawlessly with NAG f95 and prints "3".  It fails with GCC
4.1.2, 4.3.4, 4.8.0 and probably all other versions.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-09  6:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-09 17:12 [Bug fortran/53298] New: ICE in gfc_conv_scalarized_array_ref for ARRAY + substring burnus at gcc dot gnu.org
2013-04-06 11:46 ` [Bug fortran/53298] " tkoenig at gcc dot gnu.org
2013-04-27 13:31 ` dominiq at lps dot ens.fr
2020-07-23  8:36 ` bardeau at iram dot fr
2020-07-23  8:38 ` bardeau at iram dot fr
2020-07-29 10:16 ` cvs-commit at gcc dot gnu.org
2020-07-29 10:17 ` markeggleston at gcc dot gnu.org
2020-07-29 14:32 ` dominiq at lps dot ens.fr
2020-07-30  9:22 ` markeggleston at gcc dot gnu.org
2020-09-09  6:34 ` markeggleston at gcc dot gnu.org
2020-09-09  6:57 ` markeggleston 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).