* [Bug fortran/99545] [11.0 regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
@ 2021-03-11 7:47 ` juergen.reuter at desy dot de
2021-03-11 8:46 ` [Bug fortran/99545] [11 Regression] " rguenth at gcc dot gnu.org
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-11 7:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #1 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Obviously, it would be great if that regression doesn't make it into the 11.1
official release. [As it is with debug flags, that would be less dramatic than
with default flags]
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
2021-03-11 7:47 ` [Bug fortran/99545] " juergen.reuter at desy dot de
@ 2021-03-11 8:46 ` rguenth at gcc dot gnu.org
2021-03-11 9:42 ` marxin at gcc dot gnu.org
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-11 8:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |11.0
Summary|[11.0 regression] ICE in |[11 Regression] ICE in
|gfc_trans_assignment |gfc_trans_assignment
Keywords| |ice-on-valid-code
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
2021-03-11 7:47 ` [Bug fortran/99545] " juergen.reuter at desy dot de
2021-03-11 8:46 ` [Bug fortran/99545] [11 Regression] " rguenth at gcc dot gnu.org
@ 2021-03-11 9:42 ` marxin at gcc dot gnu.org
2021-03-11 11:13 ` juergen.reuter at desy dot de
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-11 9:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2021-03-11
Ever confirmed|0 |1
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Please provide a reproducer.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (2 preceding siblings ...)
2021-03-11 9:42 ` marxin at gcc dot gnu.org
@ 2021-03-11 11:13 ` juergen.reuter at desy dot de
2021-03-11 13:02 ` marxin at gcc dot gnu.org
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-11 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #3 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Created attachment 50362
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50362&action=edit
First (large) reproducer to play with, reducing atm
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (3 preceding siblings ...)
2021-03-11 11:13 ` juergen.reuter at desy dot de
@ 2021-03-11 13:02 ` marxin at gcc dot gnu.org
2021-03-11 13:04 ` juergen.reuter at desy dot de
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-11 13:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org
Status|WAITING |ASSIGNED
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Good, I can reproduce that now. I'm reducing that right now (starting with 2MB
of .f90 file).
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (4 preceding siblings ...)
2021-03-11 13:02 ` marxin at gcc dot gnu.org
@ 2021-03-11 13:04 ` juergen.reuter at desy dot de
2021-03-11 14:43 ` juergen.reuter at desy dot de
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-11 13:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #5 from Jürgen Reuter <juergen.reuter at desy dot de> ---
I'm also reducing it right now.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (5 preceding siblings ...)
2021-03-11 13:04 ` juergen.reuter at desy dot de
@ 2021-03-11 14:43 ` juergen.reuter at desy dot de
2021-03-11 14:52 ` juergen.reuter at desy dot de
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-11 14:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #6 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Voila, here is a short reproducer:
module commands
implicit none
private
type, abstract :: range_t
integer :: step_mode = 0
integer :: n_step = 0
end type range_t
type, extends (range_t) :: range_int_t
integer :: i_step = 0
end type range_int_t
type, extends (range_t) :: range_real_t
real :: lr_step = 0
end type range_real_t
type :: cmd_scan_t
private
class(range_t), dimension(:), allocatable :: range
contains
procedure :: compile => cmd_scan_compile
end type cmd_scan_t
contains
subroutine cmd_scan_compile (cmd)
class(cmd_scan_t), intent(inout) :: cmd
allocate (range_int_t :: cmd%range (3))
allocate (range_real_t :: cmd%range (3))
end subroutine cmd_scan_compile
end module commands
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (6 preceding siblings ...)
2021-03-11 14:43 ` juergen.reuter at desy dot de
@ 2021-03-11 14:52 ` juergen.reuter at desy dot de
2021-03-11 16:01 ` [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404 marxin at gcc dot gnu.org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-11 14:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #7 from Jürgen Reuter <juergen.reuter at desy dot de> ---
It actuallys is the -fcheck=mem part that triggers the ICE.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (7 preceding siblings ...)
2021-03-11 14:52 ` juergen.reuter at desy dot de
@ 2021-03-11 16:01 ` marxin at gcc dot gnu.org
2021-03-15 8:34 ` pault at gcc dot gnu.org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-11 16:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11 Regression] ICE in |[11 Regression] ICE in
|gfc_trans_assignment |gfc_trans_assignment since
| |r11-6253-gce8dcc9105cbd404
CC| |pault at gcc dot gnu.org
--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-6253-gce8dcc9105cbd404.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (8 preceding siblings ...)
2021-03-11 16:01 ` [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404 marxin at gcc dot gnu.org
@ 2021-03-15 8:34 ` pault at gcc dot gnu.org
2021-03-15 9:33 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pault at gcc dot gnu.org @ 2021-03-15 8:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Assignee|marxin at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 50386
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50386&action=edit
Fix for the PR
Juergen,
Thanks for the report and the reduction.
r11-6253-gce8dcc9105cbd404 exposed at error in gfc_trans_allocate. What is
manifestly an initialization assignment was not being flagged as such.
I will commit as obvious later on today.
Regards
Paul
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (9 preceding siblings ...)
2021-03-15 8:34 ` pault at gcc dot gnu.org
@ 2021-03-15 9:33 ` cvs-commit at gcc dot gnu.org
2021-03-15 11:09 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-15 9:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- 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:21ced2776a117924e52f6aab8b41afb613fef0e7
commit r11-7666-g21ced2776a117924e52f6aab8b41afb613fef0e7
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Mon Mar 15 09:32:52 2021 +0000
Fortran: Fix problem with allocate initialization [PR99545].
2021-03-15 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/99545
* trans-stmt.c (gfc_trans_allocate): Mark the initialization
assignment by setting init_flag.
gcc/testsuite/ChangeLog
PR fortran/99545
* gfortran.dg/pr99545.f90: New test.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (10 preceding siblings ...)
2021-03-15 9:33 ` cvs-commit at gcc dot gnu.org
@ 2021-03-15 11:09 ` cvs-commit at gcc dot gnu.org
2021-03-15 12:09 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-15 11:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #11 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:62bba614ffadb593baaaf13c881874ee96c7b7ce
commit r10-9442-g62bba614ffadb593baaaf13c881874ee96c7b7ce
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Mon Mar 15 09:32:52 2021 +0000
Fortran: Fix problem with allocate initialization [PR99545].
2021-03-15 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/99545
* trans-stmt.c (gfc_trans_allocate): Mark the initialization
assignment by setting init_flag.
gcc/testsuite/ChangeLog
PR fortran/99545
* gfortran.dg/pr99545.f90: New test.
(cherry picked from commit 21ced2776a117924e52f6aab8b41afb613fef0e7)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (11 preceding siblings ...)
2021-03-15 11:09 ` cvs-commit at gcc dot gnu.org
@ 2021-03-15 12:09 ` cvs-commit at gcc dot gnu.org
2021-03-15 13:15 ` juergen.reuter at desy dot de
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-15 12:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #12 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:b4f86a21263b8e731de68a78862e5c480ef3d160
commit r9-9284-gb4f86a21263b8e731de68a78862e5c480ef3d160
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Mon Mar 15 09:32:52 2021 +0000
Fortran: Fix problem with allocate initialization [PR99545].
2021-03-15 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/99545
* trans-stmt.c (gfc_trans_allocate): Mark the initialization
assignment by setting init_flag.
gcc/testsuite/ChangeLog
PR fortran/99545
* gfortran.dg/pr99545.f90: New test.
(cherry picked from commit 21ced2776a117924e52f6aab8b41afb613fef0e7)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (12 preceding siblings ...)
2021-03-15 12:09 ` cvs-commit at gcc dot gnu.org
@ 2021-03-15 13:15 ` juergen.reuter at desy dot de
2021-03-15 14:51 ` pault at gcc dot gnu.org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-15 13:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #13 from Jürgen Reuter <juergen.reuter at desy dot de> ---
I confirm that with that patch our code compiles again, however, more or less
all functionality fails because of runtime errors about
Fortran runtime error: Pointer actual argument '<some_name>' is not associated.
Not sure whether this is related. Shall I open another PR?
Working on a reproducer for that problem.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (13 preceding siblings ...)
2021-03-15 13:15 ` juergen.reuter at desy dot de
@ 2021-03-15 14:51 ` pault at gcc dot gnu.org
2021-03-15 14:52 ` juergen.reuter at desy dot de
2021-03-15 17:50 ` pault at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: pault at gcc dot gnu.org @ 2021-03-15 14:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #14 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Jürgen Reuter from comment #13)
> I confirm that with that patch our code compiles again, however, more or
> less all functionality fails because of runtime errors about
> Fortran runtime error: Pointer actual argument '<some_name>' is not
> associated.
> Not sure whether this is related. Shall I open another PR?
> Working on a reproducer for that problem.
Please work on a reproducer. I cannot quite see that the new problem is related
but keep this PR open for now.
The test below works, so the correct functionality of allocate is retained.
Your original reproducer no longer ICEs and gives the correct runtime error.
Cheers
Paul
! { dg-do compile }
! { dg-options "-fcheck=mem" }
!
! Test the fix for PR99545, in which the allocate statements caused an ICE.
!
! Contributed by Juergen Reuter <juergen.reuter@desy.de>
!
module commands
implicit none
! private
type, abstract :: range_t
integer :: step_mode = 0
integer :: n_step = 0
end type range_t
type, extends (range_t) :: range_int_t
integer :: i_step = 1
end type range_int_t
type, extends (range_t) :: range_real_t
real :: lr_step = 2.0
end type range_real_t
type :: cmd_scan_t
! private
class(range_t), dimension(:), allocatable :: range
contains
procedure :: compile => cmd_scan_compile
end type cmd_scan_t
contains
subroutine cmd_scan_compile (cmd, sw)
class(cmd_scan_t), intent(inout) :: cmd
integer :: sw
if (allocated (cmd%range)) deallocate (cmd%range)
if (sw .eq. 1) then
allocate (range_int_t :: cmd%range (3))
else
allocate (range_real_t :: cmd%range (3))
end if
end subroutine cmd_scan_compile
end module commands
use commands
class(cmd_scan_t), allocatable :: x
integer :: i
allocate (x)
do i = 1, 2
call x%compile (i)
select type (y => x%range)
type is (range_int_t)
print *, y%i_step
type is (range_real_t)
print *, y%lr_step
end select
end do
end
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (14 preceding siblings ...)
2021-03-15 14:51 ` pault at gcc dot gnu.org
@ 2021-03-15 14:52 ` juergen.reuter at desy dot de
2021-03-15 17:50 ` pault at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: juergen.reuter at desy dot de @ 2021-03-15 14:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
--- Comment #15 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Paul, thanks for the quick response, I opened a new one, PR99602. Please close
this one.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/99545] [11 Regression] ICE in gfc_trans_assignment since r11-6253-gce8dcc9105cbd404
2021-03-11 7:46 [Bug fortran/99545] New: [11.0 regression] ICE in gfc_trans_assignment juergen.reuter at desy dot de
` (15 preceding siblings ...)
2021-03-15 14:52 ` juergen.reuter at desy dot de
@ 2021-03-15 17:50 ` pault at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: pault at gcc dot gnu.org @ 2021-03-15 17:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99545
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #16 from Paul Thomas <pault at gcc dot gnu.org> ---
Closed as fixed on all three branches.
Paul
^ permalink raw reply [flat|nested] 18+ messages in thread