public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723
@ 2022-11-22 17:45 gscfq@t-online.de
  2022-11-22 19:04 ` [Bug fortran/107821] " anlauf at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2022-11-22 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107821
           Summary: ICE in gfc_conv_scalarized_array_ref, at
                    fortran/trans-array.cc:3723
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   associate (a => 1)
      print *, [character((a(1))) :: '1']
   end associate
end

$ cat z2.f90
program p
   associate (a => 1)
      print *, [character((a((1)))) :: '1']
   end associate
end

$ cat z3.f90
program p
   associate (a => 1)
      print *, [character(((a(1)))) :: '1']
   end associate
end

$ cat z0.f90
program p
   associate (a => 1)
      print *, [character(a(1)) :: '1']
   end associate
end


$ gfortran-13-20221120 -c z0.f90
z0.f90:3:26:

    3 |       print *, [character(a(1)) :: '1']
      |                          1
Error: Scalar INTEGER expression expected at (1)


$ gfortran-13-20221120 -c z1.f90
z1.f90:3:41:

    3 |       print *, [character((a(1))) :: '1']
      |                                         1
internal compiler error: Segmentation fault
0xda0f4f crash_signal
        ../../gcc/toplev.cc:314
0x87e95a gfc_conv_scalarized_array_ref
        ../../gcc/fortran/trans-array.cc:3723
0x87f45e gfc_conv_array_ref(gfc_se*, gfc_array_ref*, gfc_expr*, locus*)
        ../../gcc/fortran/trans-array.cc:3879
0x8ae66e gfc_conv_variable
        ../../gcc/fortran/trans-expr.cc:3104
0x8aa9ea gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9469
0x8aaaf6 gfc_conv_expr_op
        ../../gcc/fortran/trans-expr.cc:3782
0x8aaaf6 gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9457
0x8ad813 gfc_conv_expr_val(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9514
0x8ad960 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
        ../../gcc/fortran/trans-expr.cc:9528
0x887e0f trans_array_constructor
        ../../gcc/fortran/trans-array.cc:2783
0x887e0f gfc_add_loop_ss_code
        ../../gcc/fortran/trans-array.cc:3181
0x8880f5 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
        ../../gcc/fortran/trans-array.cc:5478
0x8ddd45 gfc_trans_transfer(gfc_code*)
        ../../gcc/fortran/trans-io.cc:2671
0x879a37 trans_code
        ../../gcc/fortran/trans.cc:2170
0x8db6ce build_dt
        ../../gcc/fortran/trans-io.cc:2051
0x879a17 trans_code
        ../../gcc/fortran/trans.cc:2142
0x8f71af gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.cc:2314
0x879917 trans_code
        ../../gcc/fortran/trans.cc:2046
0x8a2e1e gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.cc:7674
0x824fae translate_all_program_units
        ../../gcc/fortran/parse.cc:6696

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

* [Bug fortran/107821] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723
  2022-11-22 17:45 [Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723 gscfq@t-online.de
@ 2022-11-22 19:04 ` anlauf at gcc dot gnu.org
  2023-06-08  6:11 ` cvs-commit at gcc dot gnu.org
  2023-06-08  6:21 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-22 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org
   Last reconfirmed|                            |2022-11-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

Note that I also get an ICE on z0.f90 with gcc <= 12.
So we already got slightly better...

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

* [Bug fortran/107821] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723
  2022-11-22 17:45 [Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723 gscfq@t-online.de
  2022-11-22 19:04 ` [Bug fortran/107821] " anlauf at gcc dot gnu.org
@ 2023-06-08  6:11 ` cvs-commit at gcc dot gnu.org
  2023-06-08  6:21 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-08  6:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:d08f2e4f74583e27002368989bba197f8eb7f6d2

commit r14-1629-gd08f2e4f74583e27002368989bba197f8eb7f6d2
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Thu Jun 8 07:11:32 2023 +0100

    Fortran: Fix some more blockers in associate meta-bug [PR87477]

    2023-06-08  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/87477
            PR fortran/99350
            PR fortran/107821
            PR fortran/109451
            * decl.cc (char_len_param_value): Simplify a copy of the expr
            and replace the original if there is no error.
            * gfortran.h : Remove the redundant field 'rankguessed' from
            'gfc_association_list'.
            * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
            (resolve_variable): Associate names with constant or structure
            constructor targets cannot have array refs.
            * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
            character length backend decl before using it. Suppress the
            assignment if lhs equals rhs.
            * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
            associate variables pointing to a variable. Add comment.
            * trans-stmt.cc (trans_associate_var): Remove requirement that
            the character length be deferred before assigning the value
            returned by gfc_conv_expr_descriptor. Also, guard the backend
            decl before testing with VAR_P.

    gcc/testsuite/
            PR fortran/99350
            * gfortran.dg/pr99350.f90 : New test.

            PR fortran/107821
            * gfortran.dg/associate_5.f03 : Changed error message.
            * gfortran.dg/pr107821.f90 : New test.

            PR fortran/109451
            * gfortran.dg/associate_61.f90 : New test

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

* [Bug fortran/107821] ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723
  2022-11-22 17:45 [Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723 gscfq@t-online.de
  2022-11-22 19:04 ` [Bug fortran/107821] " anlauf at gcc dot gnu.org
  2023-06-08  6:11 ` cvs-commit at gcc dot gnu.org
@ 2023-06-08  6:21 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2023-06-08  6:21 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed on trunk.

Thanks for the report

Paul

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

end of thread, other threads:[~2023-06-08  6:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 17:45 [Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723 gscfq@t-online.de
2022-11-22 19:04 ` [Bug fortran/107821] " anlauf at gcc dot gnu.org
2023-06-08  6:11 ` cvs-commit at gcc dot gnu.org
2023-06-08  6:21 ` pault 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).