* [Bug fortran/103392] [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
@ 2021-11-23 19:00 ` gscfq@t-online.de
2021-11-23 19:47 ` anlauf at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-11-23 19:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
G. Steinmetz <gscfq@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---
More variants :
$ cat z2.f90
program p
integer, allocatable :: a(1:)
integer :: b(1) = lbound(a)
integer :: c(1) = ubound(a)
end
$ cat z3.f90
program p
integer, allocatable :: a(1)
integer :: b(1) = lbound(a)
integer :: c(1) = ubound(a)
end
$ cat z4.f90
program p
integer, allocatable :: a(1)
integer :: b = lbound(a)
integer :: c = ubound(a)
end
$ cat z5.f90
program p
integer, allocatable :: a(1:)
integer :: b, c
b = lbound(a)
c = ubound(a)
end
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
2021-11-23 19:00 ` [Bug fortran/103392] " gscfq@t-online.de
@ 2021-11-23 19:47 ` anlauf at gcc dot gnu.org
2021-11-23 20:47 ` 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-11-23 19:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-11-23
CC| |anlauf at gcc dot gnu.org
--- Comment #2 from anlauf at gcc dot gnu.org ---
Confirmed.
Tentative patch:
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 6a6b3fbd037..477fd095b2d 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4266,6 +4266,9 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr
*kind, int upper)
|| (as->type == AS_ASSUMED_SHAPE && upper)))
return NULL;
+ if (gfc_expr_attr (array).allocatable || gfc_expr_attr (array).pointer)
+ return NULL;
+
gcc_assert (!as
|| (as->type != AS_DEFERRED
&& array->expr_type == EXPR_VARIABLE
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
2021-11-23 19:00 ` [Bug fortran/103392] " gscfq@t-online.de
2021-11-23 19:47 ` anlauf at gcc dot gnu.org
@ 2021-11-23 20:47 ` anlauf at gcc dot gnu.org
2021-11-23 21:02 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-23 20:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
Priority|P3 |P4
Status|NEW |ASSIGNED
--- Comment #3 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2021-November/057054.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (2 preceding siblings ...)
2021-11-23 20:47 ` anlauf at gcc dot gnu.org
@ 2021-11-23 21:02 ` cvs-commit at gcc dot gnu.org
2021-11-24 8:41 ` [Bug fortran/103392] [9/10/11 " marxin at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-23 21:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:16e95050f71e9fa408e9bd8ccd415b0e7adc66e5
commit r12-5480-g16e95050f71e9fa408e9bd8ccd415b0e7adc66e5
Author: Harald Anlauf <anlauf@gmx.de>
Date: Tue Nov 23 21:39:36 2021 +0100
Fortran: do not attempt simplification of [LU]BOUND for pointer/allocatable
gcc/fortran/ChangeLog:
PR fortran/103392
* simplify.c (simplify_bound): Do not try to simplify
LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.
gcc/testsuite/ChangeLog:
PR fortran/103392
* gfortran.dg/bound_simplification_7.f90: New test.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (3 preceding siblings ...)
2021-11-23 21:02 ` cvs-commit at gcc dot gnu.org
@ 2021-11-24 8:41 ` marxin at gcc dot gnu.org
2021-11-24 8:41 ` marxin at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-24 8:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
|in simplify_bound, at |simplify_bound, at
|fortran/simplify.c:4273 |fortran/simplify.c:4273
CC| |marxin at gcc dot gnu.org
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master with r12-5480-g16e95050f71e9fa4 and it started with
r6-597-g22fa926f19ae0ebb.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (4 preceding siblings ...)
2021-11-24 8:41 ` [Bug fortran/103392] [9/10/11 " marxin at gcc dot gnu.org
@ 2021-11-24 8:41 ` marxin at gcc dot gnu.org
2021-11-24 8:53 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-24 8:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
@Anlauf: Heh, you fixed faster than I made bisection :P
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (5 preceding siblings ...)
2021-11-24 8:41 ` marxin at gcc dot gnu.org
@ 2021-11-24 8:53 ` rguenth at gcc dot gnu.org
2021-11-24 21:35 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-24 8:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (6 preceding siblings ...)
2021-11-24 8:53 ` rguenth at gcc dot gnu.org
@ 2021-11-24 21:35 ` cvs-commit at gcc dot gnu.org
2021-11-26 20:45 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-24 21:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:56b3036c531929e0dae1103b9f5d20c82643415f
commit r11-9308-g56b3036c531929e0dae1103b9f5d20c82643415f
Author: Harald Anlauf <anlauf@gmx.de>
Date: Tue Nov 23 21:39:36 2021 +0100
Fortran: do not attempt simplification of [LU]BOUND for pointer/allocatable
gcc/fortran/ChangeLog:
PR fortran/103392
* simplify.c (simplify_bound): Do not try to simplify
LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.
gcc/testsuite/ChangeLog:
PR fortran/103392
* gfortran.dg/bound_simplification_7.f90: New test.
(cherry picked from commit 16e95050f71e9fa408e9bd8ccd415b0e7adc66e5)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (7 preceding siblings ...)
2021-11-24 21:35 ` cvs-commit at gcc dot gnu.org
@ 2021-11-26 20:45 ` cvs-commit at gcc dot gnu.org
2021-11-26 20:50 ` cvs-commit at gcc dot gnu.org
2021-11-26 20:50 ` anlauf at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-26 20:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:376b2c781d11f55644e92dfea91c3f214f20f4ac
commit r10-10311-g376b2c781d11f55644e92dfea91c3f214f20f4ac
Author: Harald Anlauf <anlauf@gmx.de>
Date: Tue Nov 23 21:39:36 2021 +0100
Fortran: do not attempt simplification of [LU]BOUND for pointer/allocatable
gcc/fortran/ChangeLog:
PR fortran/103392
* simplify.c (simplify_bound): Do not try to simplify
LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.
gcc/testsuite/ChangeLog:
PR fortran/103392
* gfortran.dg/bound_simplification_7.f90: New test.
(cherry picked from commit 16e95050f71e9fa408e9bd8ccd415b0e7adc66e5)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (8 preceding siblings ...)
2021-11-26 20:45 ` cvs-commit at gcc dot gnu.org
@ 2021-11-26 20:50 ` cvs-commit at gcc dot gnu.org
2021-11-26 20:50 ` anlauf at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-26 20:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:dd1871c823e2ec9a500ac5ad3c87a117b934fa3b
commit r9-9846-gdd1871c823e2ec9a500ac5ad3c87a117b934fa3b
Author: Harald Anlauf <anlauf@gmx.de>
Date: Tue Nov 23 21:39:36 2021 +0100
Fortran: do not attempt simplification of [LU]BOUND for pointer/allocatable
gcc/fortran/ChangeLog:
PR fortran/103392
* simplify.c (simplify_bound): Do not try to simplify
LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.
gcc/testsuite/ChangeLog:
PR fortran/103392
* gfortran.dg/bound_simplification_7.f90: New test.
(cherry picked from commit 16e95050f71e9fa408e9bd8ccd415b0e7adc66e5)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103392] [9/10/11 Regression] ICE in simplify_bound, at fortran/simplify.c:4273
2021-11-23 19:00 [Bug fortran/103392] New: [9/10/11/12 Regression] ICE in simplify_bound, at fortran/simplify.c:4273 gscfq@t-online.de
` (9 preceding siblings ...)
2021-11-26 20:50 ` cvs-commit at gcc dot gnu.org
@ 2021-11-26 20:50 ` anlauf at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-26 20:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from anlauf at gcc dot gnu.org ---
Fixed on all open branches down to gcc-9. Closing.
Thanks for the report!
^ permalink raw reply [flat|nested] 12+ messages in thread