public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components
@ 2021-03-14 19:45 anlauf at gcc dot gnu.org
  2021-03-14 19:46 ` [Bug fortran/99585] " anlauf at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-03-14 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99585
           Summary: ICE with SIZE intrinsic on nested derived type
                    components
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

As reported by Tobias Burnus in

https://gcc.gnu.org/pipermail/fortran/2021-March/055815.html

the following code ICEs with all gcc since at least 7:

module m
  type t
     class(*), pointer :: bar(:)
  end type
  type t2
     class(t), allocatable :: my(:)
  end type t2
contains
  function f (x, y) result(z)
    class(t) :: x(:)
    class(t) :: y(size(x(1)%bar))
    type(t)  :: z(size(x(1)%bar))
  end
  function g (x) result(z)
    class(t) :: x(:)
    type(t)  :: z(size(x(1)%bar))
  end
  subroutine s ()
    class(t2), allocatable :: a(:), b(:), c(:), d(:)
    class(t2), pointer     :: p(:)
    c(1)%my = f (a(1)%my, b(1)%my)
    d(1)%my = g (p(1)%my)
  end
end

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
@ 2021-03-14 19:46 ` anlauf at gcc dot gnu.org
  2021-03-14 20:27 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-03-14 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2021-03-14
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.2.1, 11.0, 7.5.0, 8.4.1,
                   |                            |9.3.1

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
  2021-03-14 19:46 ` [Bug fortran/99585] " anlauf at gcc dot gnu.org
@ 2021-03-14 20:27 ` anlauf at gcc dot gnu.org
  2021-03-14 21:06 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-03-14 20:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from anlauf at gcc dot gnu.org ---
Reduced example:

module m
  type t
  end type
  type t2
     type(t), allocatable :: my(:)
  end type t2
contains
  function h (x) result(z)
    class(t2) :: x(:)
    type(t)   :: z(size(x(1)%my))
  end
  subroutine s ()
    type(t2), allocatable :: a(:)
    type(t),  allocatable :: u(:)
    u = h (a)
  end
end

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
  2021-03-14 19:46 ` [Bug fortran/99585] " anlauf at gcc dot gnu.org
  2021-03-14 20:27 ` anlauf at gcc dot gnu.org
@ 2021-03-14 21:06 ` anlauf at gcc dot gnu.org
  2021-03-15  9:07 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-03-14 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
Actually the SIZE intrinsic might be a red herring, as the following variant
does also ICE:

module m
  type t
  end type
  type t2
     integer :: n
  end type t2
contains
  function h (x) result(z)
    class(t2) :: x(:)      ! ICE
!   type(t2)  :: x(:)      ! no ICE
    type(t)   :: z(x(1)%n)
  end
  subroutine s
    type(t2), allocatable :: a(:)
    type(t),  allocatable :: u(:)
    u = h (a)
  end
end

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-03-14 21:06 ` anlauf at gcc dot gnu.org
@ 2021-03-15  9:07 ` marxin at gcc dot gnu.org
  2022-03-07 21:12 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-15  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r6-202-gf3b0bb7a560be0f0.

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-03-15  9:07 ` marxin at gcc dot gnu.org
@ 2022-03-07 21:12 ` cvs-commit at gcc dot gnu.org
  2022-03-19  7:49 ` cvs-commit at gcc dot gnu.org
  2023-08-27 19:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-07 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

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

commit r12-7526-gc0134b7383992aab5c1a91440dbdd8fbb747169c
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Mar 7 22:11:33 2022 +0100

    Fortran: Fix gfc_maybe_dereference_var [PR104430][PR99585]

            PR fortran/99585
            PR fortran/104430

    gcc/fortran/ChangeLog:

            * trans-expr.cc (conv_parent_component_references): Fix comment;
            simplify comparison.
            (gfc_maybe_dereference_var): Avoid d referencing a nonpointer.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/class_result_10.f90: New test.

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-03-07 21:12 ` cvs-commit at gcc dot gnu.org
@ 2022-03-19  7:49 ` cvs-commit at gcc dot gnu.org
  2023-08-27 19:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-19  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Tobias Burnus
<burnus@gcc.gnu.org>:

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

commit r11-9671-gd32402e6167294ad8ba84ffccebff1b098d2b4e1
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Mar 7 22:11:33 2022 +0100

    Fortran: Fix gfc_maybe_dereference_var [PR104430][PR99585]

            PR fortran/99585
            PR fortran/104430

    gcc/fortran/ChangeLog:

            * trans-expr.c (conv_parent_component_references): Fix comment;
            simplify comparison.
            (gfc_maybe_dereference_var): Avoid d referencing a nonpointer.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/class_result_10.f90: New test.

    (cherry picked from commit c0134b7383992aab5c1a91440dbdd8fbb747169c)

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

* [Bug fortran/99585] ICE with SIZE intrinsic on nested derived type components
  2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-03-19  7:49 ` cvs-commit at gcc dot gnu.org
@ 2023-08-27 19:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-08-27 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Known to work|                            |11.3.0, 12.3.0, 13.1.0,
                   |                            |14.0
             Status|NEW                         |RESOLVED

--- Comment #6 from anlauf at gcc dot gnu.org ---
Fixed.

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

end of thread, other threads:[~2023-08-27 19:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 19:45 [Bug fortran/99585] New: ICE with SIZE intrinsic on nested derived type components anlauf at gcc dot gnu.org
2021-03-14 19:46 ` [Bug fortran/99585] " anlauf at gcc dot gnu.org
2021-03-14 20:27 ` anlauf at gcc dot gnu.org
2021-03-14 21:06 ` anlauf at gcc dot gnu.org
2021-03-15  9:07 ` marxin at gcc dot gnu.org
2022-03-07 21:12 ` cvs-commit at gcc dot gnu.org
2022-03-19  7:49 ` cvs-commit at gcc dot gnu.org
2023-08-27 19:48 ` 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).