public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
@ 2021-02-16 17:45 gscfq@t-online.de
  2021-02-16 18:41 ` [Bug fortran/99124] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2021-02-16 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99124
           Summary: [9/10/11 Regression] ICE in gfc_get_class_from_expr,
                    at fortran/trans-expr.c:541
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20201213 and 20210110 :
(compiles with x=x+y and x=y+z, respectivly)
(but not sure if valid at all)


$ cat z1.f90
module m
   type t
   contains
      procedure :: f
      generic :: operator(+) => f
   end type
contains
   elemental function f(a, b) result(c)
      class(t), intent(in) :: a, b
      class(t), allocatable :: c
   end
end
program p
   use m
   class(t), allocatable :: x(:), y(:)
   x = x(2) + y
end


$ cat z2.f90
module m
   type t
   contains
      procedure :: f
      generic :: operator(+) => f
   end type
contains
   elemental function f(a, b) result(c)
      class(t), intent(in) :: a, b
      class(t), allocatable :: c
   end
end
program p
   use m
   class(t), allocatable :: x(:), y(:), z
   z = x(1)
   x = z + y
end



$ gfortran-11-20201213 -c z1.f90
$
$ gfortran-11-20210214 -c z1.f90
z1.f90:16:15:

   16 |    x = x(2) + y
      |               1
internal compiler error: Segmentation fault
0xc09bcf crash_signal
        ../../gcc/toplev.c:327
0x763649 gfc_get_class_from_expr(tree_node*)
        ../../gcc/fortran/trans-expr.c:541
0x73d6a4 get_class_info_from_ss
        ../../gcc/fortran/trans-array.c:1171
0x73d6a4 gfc_trans_create_temp_array(stmtblock_t*, stmtblock_t*, gfc_ss*,
tree_node*, tree_node*, bool, bool, bool, locus*)
        ../../gcc/fortran/trans-array.c:1313
0x7483d2 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
        ../../gcc/fortran/trans-array.c:5339
0x77778d gfc_trans_assignment_1
        ../../gcc/fortran/trans-expr.c:11128
0x739de7 trans_code
        ../../gcc/fortran/trans.c:1922
0x760554 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6880
0x6e6e86 translate_all_program_units
        ../../gcc/fortran/parse.c:6351
0x6e6e86 gfc_parse_file()
        ../../gcc/fortran/parse.c:6620
0x7330ff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
@ 2021-02-16 18:41 ` marxin at gcc dot gnu.org
  2021-02-18  9:10 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-16 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-02-16
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-6253-gce8dcc9105cbd404.

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
  2021-02-16 18:41 ` [Bug fortran/99124] " marxin at gcc dot gnu.org
@ 2021-02-18  9:10 ` rguenth at gcc dot gnu.org
  2021-02-23 19:29 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-18  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4
           Priority|P3                          |P4

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
  2021-02-16 18:41 ` [Bug fortran/99124] " marxin at gcc dot gnu.org
  2021-02-18  9:10 ` rguenth at gcc dot gnu.org
@ 2021-02-23 19:29 ` cvs-commit at gcc dot gnu.org
  2021-02-24 11:11 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-23 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:29a5298955f777c539c628f51e78b75d8e586c44

commit r11-7349-g29a5298955f777c539c628f51e78b75d8e586c44
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Feb 23 19:29:04 2021 +0000

    Fortran: Fix for class defined operators [PR99124].

    2021-02-23  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/99124
            * resolve.c (resolve_fl_procedure): Include class results in
            the test for F2018, C15100.
            * trans-array.c (get_class_info_from_ss): Do not use the saved
            descriptor to obtain the class expression for variables. Use
            gfc_get_class_from_expr instead.

    gcc/testsuite/
            PR fortran/99124
            * gfortran.dg/class_defined_operator_2.f03 : New test.
            * gfortran.dg/elemental_result_2.f90 : New test.
            * gfortran.dg/class_assign_4.f90: Correct the non-conforming
            elemental function with an allocatable result with an operator
            interface with array dummies and result.

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-23 19:29 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 11:11 ` cvs-commit at gcc dot gnu.org
  2021-02-24 12:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:01af81169f0b92ee2823e86c37066f8f002c21c0

commit r10-9387-g01af81169f0b92ee2823e86c37066f8f002c21c0
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Feb 23 19:29:04 2021 +0000

    Fortran: Fix for class defined operators [PR99124].

    2021-02-23  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/99124
            * resolve.c (resolve_fl_procedure): Include class results in
            the test for F2018, C15100.
            * trans-array.c (get_class_info_from_ss): Do not use the saved
            descriptor to obtain the class expression for variables. Use
            gfc_get_class_from_expr instead.

    gcc/testsuite/
            PR fortran/99124
            * gfortran.dg/class_defined_operator_2.f03 : New test.
            * gfortran.dg/elemental_result_2.f90 : New test.
            * gfortran.dg/class_assign_4.f90: Correct the non-conforming
            elemental function with an allocatable result with an operator
            interface with array dummies and result.

    (cherry picked from commit 29a5298955f777c539c628f51e78b75d8e586c44)

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-02-24 11:11 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 12:14 ` cvs-commit at gcc dot gnu.org
  2021-02-24 12:57 ` pault at gcc dot gnu.org
  2021-02-24 12:58 ` pault at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r9-9249-gcd34d8b7b50f0f3592deb76983191c3d9a5dbcb9
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Feb 23 19:29:04 2021 +0000

    Fortran: Fix for class defined operators [PR99124].

    2021-02-23  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/99124
            * resolve.c (resolve_fl_procedure): Include class results in
            the test for F2018, C15100.
            * trans-array.c (get_class_info_from_ss): Do not use the saved
            descriptor to obtain the class expression for variables. Use
            gfc_get_class_from_expr instead.

    gcc/testsuite/
            PR fortran/99124
            * gfortran.dg/class_defined_operator_2.f03 : New test.
            * gfortran.dg/elemental_result_2.f90 : New test.
            * gfortran.dg/class_assign_4.f90: Correct the non-conforming
            elemental function with an allocatable result with an operator
            interface with array dummies and result.

    (cherry picked from commit 29a5298955f777c539c628f51e78b75d8e586c44)

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-02-24 12:14 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 12:57 ` pault at gcc dot gnu.org
  2021-02-24 12:58 ` pault at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2021-02-24 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed on all three branches.

Thanks for the report. I hope that the constraint on class-valued elemental
functions doesn't spoil any code.

Cheers

Paul

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

* [Bug fortran/99124] [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541
  2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-02-24 12:57 ` pault at gcc dot gnu.org
@ 2021-02-24 12:58 ` pault at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2021-02-24 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
It helps to mark it as fixed :-)

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

end of thread, other threads:[~2021-02-24 12:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 17:45 [Bug fortran/99124] New: [9/10/11 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:541 gscfq@t-online.de
2021-02-16 18:41 ` [Bug fortran/99124] " marxin at gcc dot gnu.org
2021-02-18  9:10 ` rguenth at gcc dot gnu.org
2021-02-23 19:29 ` cvs-commit at gcc dot gnu.org
2021-02-24 11:11 ` cvs-commit at gcc dot gnu.org
2021-02-24 12:14 ` cvs-commit at gcc dot gnu.org
2021-02-24 12:57 ` pault at gcc dot gnu.org
2021-02-24 12:58 ` 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).