public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101513] New: ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313
@ 2021-07-19 17:25 gscfq@t-online.de
  2021-07-19 20:02 ` [Bug fortran/101513] " anlauf at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gscfq@t-online.de @ 2021-07-19 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101513
           Summary: ICE in gfc_alloc_allocatable_for_assignment, at
                    fortran/trans-array.c:10313
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Follow-up of pr100656 :


$ cat z1.f90
subroutine s(x)
   character(:), allocatable, optional :: x(:)
   if ( present(x) ) then
      if ( allocated(x) ) then
         x = ('a' // x // 'e')
      end if
   end if
end


$ cat z2.f90
subroutine s(x)
   character(:), allocatable :: x(:)
   if ( allocated(x) ) then
      x = ('a' // x // 'e')
   end if
end


$ gfortran-12-20210718 -c z1.f90
z1.f90:5:30:

    5 |          x = ('a' // x // 'e')
      |                              1
internal compiler error: Segmentation fault
0xc9a8df crash_signal
        ../../gcc/toplev.c:328
0x9ca410 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2394
0x7c7ad6 gfc_alloc_allocatable_for_assignment(gfc_loopinfo*, gfc_expr*,
gfc_expr*)
        ../../gcc/fortran/trans-array.c:10313
0x7f1f65 gfc_trans_assignment_1
        ../../gcc/fortran/trans-expr.c:11592
0x7b3287 trans_code
        ../../gcc/fortran/trans.c:1918
0x821a45 gfc_trans_if_1
        ../../gcc/fortran/trans-stmt.c:1475
0x8295da gfc_trans_if(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1507
0x7b33a7 trans_code
        ../../gcc/fortran/trans.c:2006
0x821a45 gfc_trans_if_1
        ../../gcc/fortran/trans-stmt.c:1475
0x8295da gfc_trans_if(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1507
0x7b33a7 trans_code
        ../../gcc/fortran/trans.c:2006
0x7d9ae4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6898
0x760266 translate_all_program_units
        ../../gcc/fortran/parse.c:6464
0x760266 gfc_parse_file()
        ../../gcc/fortran/parse.c:6733
0x7ac58f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

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

* [Bug fortran/101513] ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313
  2021-07-19 17:25 [Bug fortran/101513] New: ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313 gscfq@t-online.de
@ 2021-07-19 20:02 ` anlauf at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-07-19 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-07-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

Workaround: do not use parentheses on the rhs.

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

end of thread, other threads:[~2021-07-19 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 17:25 [Bug fortran/101513] New: ICE in gfc_alloc_allocatable_for_assignment, at fortran/trans-array.c:10313 gscfq@t-online.de
2021-07-19 20:02 ` [Bug fortran/101513] " anlauf 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).