public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
@ 2021-06-07 17:31 gscfq@t-online.de
  2021-06-07 18:02 ` [Bug fortran/100948] " gscfq@t-online.de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-06-07 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100948
           Summary: [12 Regression] ICE in gfc_conv_expr_val, at
                    fortran/trans-expr.c:9069
           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: ---

This changed between 20210530 (accepted) and 20210606 (ICE) :
(see also pr83522)


$ cat z1.f90
program p
   type t
      character(:), allocatable :: c(:)
   end type
   type(t), allocatable :: x
   associate (y => x%c(:)(:))
   end associate
end


$ gfortran-12-20210530 -c z1.f90
$
$ gfortran-12-20210606 -c z1.f90
z1.f90:6:29:

    6 |    associate (y => x%c(:)(:))
      |                             1
internal compiler error: Segmentation fault
0xc79a6f crash_signal
        ../../gcc/toplev.c:327
0x7cf4f6 gfc_conv_expr_val(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:9069
0x7cf723 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
        ../../gcc/fortran/trans-expr.c:9084
0x7cf723 gfc_get_expr_charlen(gfc_expr*)
        ../../gcc/fortran/trans-expr.c:2158
0x7a11bf gfc_get_array_span(tree_node*, gfc_expr*)
        ../../gcc/fortran/trans-array.c:873
0x7acab0 gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-array.c:7740
0x80d462 trans_associate_var
        ../../gcc/fortran/trans-stmt.c:1917
0x8141f1 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:2311
0x79e5a7 trans_code
        ../../gcc/fortran/trans.c:2014
0x7c4bc4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6893
0x74b3f6 translate_all_program_units
        ../../gcc/fortran/parse.c:6461
0x74b3f6 gfc_parse_file()
        ../../gcc/fortran/parse.c:6730
0x79772f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
@ 2021-06-07 18:02 ` gscfq@t-online.de
  2021-06-07 19:34 ` anlauf at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-06-07 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---

Additionally a better/valid example :

$ cat z3.f90
program p
   type t
      character(:), allocatable :: c(:)
   end type
   type(t), allocatable :: x
   x = t(['abc', 'uvw'])
   associate (y => x%c(:)(:))
      print *, y
   end associate
end

# should print :
abcuvw

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
  2021-06-07 18:02 ` [Bug fortran/100948] " gscfq@t-online.de
@ 2021-06-07 19:34 ` anlauf at gcc dot gnu.org
  2021-06-07 19:36 ` anlauf at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-07 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-06-07
     Ever confirmed|0                           |1
                 CC|                            |anlauf at gcc dot gnu.org,
                   |                            |jrfsousa at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
Possible candidate: r12-1233

CCing Jose.

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
  2021-06-07 18:02 ` [Bug fortran/100948] " gscfq@t-online.de
  2021-06-07 19:34 ` anlauf at gcc dot gnu.org
@ 2021-06-07 19:36 ` anlauf at gcc dot gnu.org
  2021-06-11 12:37 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-07 19:36 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-06-07 19:36 ` anlauf at gcc dot gnu.org
@ 2021-06-11 12:37 ` marxin at gcc dot gnu.org
  2021-06-11 15:33 ` jrfsousa at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-11 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Likely started with r8-3365-gb89a63b916340ef2.

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-06-11 12:37 ` marxin at gcc dot gnu.org
@ 2021-06-11 15:33 ` jrfsousa at gcc dot gnu.org
  2021-06-13 19:15 ` jrfsousa at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-06-11 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
I am looking into this.

I think I already have a patch for the ICE, but there are further problems
which I am trying to solve.

Best regards,
José Rui

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-06-11 15:33 ` jrfsousa at gcc dot gnu.org
@ 2021-06-13 19:15 ` jrfsousa at gcc dot gnu.org
  2021-06-13 19:16 ` jrfsousa at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-06-13 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
Partial patch posted:

https://gcc.gnu.org/pipermail/fortran/2021-June/056155.html

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-06-13 19:15 ` jrfsousa at gcc dot gnu.org
@ 2021-06-13 19:16 ` jrfsousa at gcc dot gnu.org
  2022-01-17 14:37 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-06-13 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
Created attachment 51002
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51002&action=edit
Patch and changelog

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

* [Bug fortran/100948] [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-06-13 19:16 ` jrfsousa at gcc dot gnu.org
@ 2022-01-17 14:37 ` rguenth at gcc dot gnu.org
  2022-05-06  8:30 ` [Bug fortran/100948] [12/13 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 14:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug fortran/100948] [12/13 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2022-01-17 14:37 ` rguenth at gcc dot gnu.org
@ 2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2023-04-08  8:04 ` cvs-commit at gcc dot gnu.org
  2023-04-08  9:33 ` pault at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug fortran/100948] [12/13 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2022-05-06  8:30 ` [Bug fortran/100948] [12/13 " jakub at gcc dot gnu.org
@ 2023-04-08  8:04 ` cvs-commit at gcc dot gnu.org
  2023-04-08  9:33 ` pault at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-08  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 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:eac493851f07df98213ecf67a5e9ab41a7babcd2

commit r13-7121-geac493851f07df98213ecf67a5e9ab41a7babcd2
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Sat Apr 8 09:04:13 2023 +0100

    Fortran: Fix some of the bugs in associate [PR87477]

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

    gcc/fortran
            PR fortran/87477
            * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
            string length is deferred use the string typespec for result.
            * resolve.cc (resolve_assoc_var): Handle parentheses around the
            target expression.
            (resolve_block_construct): Remove unnecessary static decls.
            * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
            expression in condition. Improve handling of string length and
            span, especially for substrings of the descriptor.
            (duplicate_allocatable): Make element type more explicit with
            'eltype'.
            * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
            appropriate message instead of ICE if symbol type is unknown.
            (gfc_generate_function_code): Set current locus to proc_sym
            declared_at.
            * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
            'previous' and use if end expression in substring reference is
            null.
            (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
            'expr_flat' is an array. Add post block to catch deallocation
            of temporaries.
            (gfc_conv_procedure_call): Assign the parmse string length to
            the expression string length, if it is deferred.
            (gfc_trans_alloc_subarray_assign): If this is a deferred string
            length component, store the string length in the hidden comp.
            Update the typespec length accordingly. Generate a new type
            spec for the call to gfc_duplicate-allocatable in this case.
            * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
            deferred character array components.

    gcc/testsuite/
            PR fortran/87477
            * gfortran.dg/associate_47.f90 : Enable substring test.
            * gfortran.dg/associate_51.f90 : Update an error message.
            * gfortran.dg/goacc/array-with-dt-2.f90 : Add span to
            uninitialzed dg-warnings.

            PR fortran/85686
            PR fortran/88247
            PR fortran/91941
            PR fortran/92779
            PR fortran/93339
            PR fortran/93813
            PR fortran/100948
            PR fortran/102106
            * gfortran.dg/associate_60.f90 : New test

            PR fortran/98408
            * gfortran.dg/pr98408.f90 : New test

            PR fortran/105205
            * gfortran.dg/pr105205.f90 : New test

            PR fortran/106918
            * gfortran.dg/pr106918.f90 : New test

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

* [Bug fortran/100948] [12/13 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069
  2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
                   ` (9 preceding siblings ...)
  2023-04-08  8:04 ` cvs-commit at gcc dot gnu.org
@ 2023-04-08  9:33 ` pault at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu.org @ 2023-04-08  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Thanks for the report

Paul

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

end of thread, other threads:[~2023-04-08  9:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 17:31 [Bug fortran/100948] New: [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 gscfq@t-online.de
2021-06-07 18:02 ` [Bug fortran/100948] " gscfq@t-online.de
2021-06-07 19:34 ` anlauf at gcc dot gnu.org
2021-06-07 19:36 ` anlauf at gcc dot gnu.org
2021-06-11 12:37 ` marxin at gcc dot gnu.org
2021-06-11 15:33 ` jrfsousa at gcc dot gnu.org
2021-06-13 19:15 ` jrfsousa at gcc dot gnu.org
2021-06-13 19:16 ` jrfsousa at gcc dot gnu.org
2022-01-17 14:37 ` rguenth at gcc dot gnu.org
2022-05-06  8:30 ` [Bug fortran/100948] [12/13 " jakub at gcc dot gnu.org
2023-04-08  8:04 ` cvs-commit at gcc dot gnu.org
2023-04-08  9:33 ` 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).