* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
@ 2021-12-15 11:16 ` marxin at gcc dot gnu.org
2021-12-15 19:56 ` anlauf at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-15 11:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Summary|[10/11/12 Regression] ICE |[10/11/12 Regression] ICE
|in gimplify_expr, at |in gimplify_expr, at
|gimplify.c:15964 |gimplify.c:15964 since
| |r9-3803-ga5fbc2f36a291cbe
Last reconfirmed| |2021-12-15
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> ---
Started with r9-3803-ga5fbc2f36a291cbe.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
2021-12-15 11:16 ` [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe marxin at gcc dot gnu.org
@ 2021-12-15 19:56 ` anlauf at gcc dot gnu.org
2021-12-16 8:57 ` gscfq@t-online.de
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-15 19:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #2 from anlauf at gcc dot gnu.org ---
No ICE for
print *, g((x%len))
Furthermore, adding an interface
interface
function g(x)
integer, intent(in) :: x
end function g
end interface
in the original testcase gives the error:
pr103716-z1.f90:11:13:
11 | print *, g(x%len)
| 1
Error: Rank mismatch in argument 'x' at (1) (scalar and rank-1)
This is wrong: x%len is actually a scalar.
* * *
I am not happy that this is marked as a regression, as the %len inquiry did
not exist before the commit in the subject. If somebody else agrees, we should
remove that.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
2021-12-15 11:16 ` [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe marxin at gcc dot gnu.org
2021-12-15 19:56 ` anlauf at gcc dot gnu.org
@ 2021-12-16 8:57 ` gscfq@t-online.de
2021-12-16 17:23 ` anlauf at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: gscfq@t-online.de @ 2021-12-16 8:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #3 from G. Steinmetz <gscfq@t-online.de> ---
On my environment(s) the history for r9 is as follows :
<= 20181028 : Error: Unexpected '%' for nonderived-type variable 'x' at
(1)
20181104..20190824 : ICE in check_assumed_size_reference/gfc_format_decoder
20191005..20200125 : ICE in gimplify_expr
>= 20200508 : accepted, no Error, no ICE
(sorry for the sparse coverage with r9 binaries between 20200125 and 20200508)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (2 preceding siblings ...)
2021-12-16 8:57 ` gscfq@t-online.de
@ 2021-12-16 17:23 ` anlauf at gcc dot gnu.org
2021-12-16 21:32 ` anlauf at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-16 17:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #3)
> On my environment(s) the history for r9 is as follows :
>
> <= 20181028 : Error: Unexpected '%' for nonderived-type variable 'x'
> at (1)
> 20181104..20190824 : ICE in check_assumed_size_reference/gfc_format_decoder
> 20191005..20200125 : ICE in gimplify_expr
> >= 20200508 : accepted, no Error, no ICE
>
> (sorry for the sparse coverage with r9 binaries between 20200125 and
> 20200508)
OK, I checked again, and find top-of-the-branch r9 generating questionable
code.
print *, g(x%len)
generates
D.3874 = g (&(integer(kind=4)) _x, _x);
(note the 2 arguments), while
print *, g(len(x))
generates
D.3876 = (integer(kind=4)) _x;
D.3877 = g (&D.3876);
which is how it should have been.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (3 preceding siblings ...)
2021-12-16 17:23 ` anlauf at gcc dot gnu.org
@ 2021-12-16 21:32 ` anlauf at gcc dot gnu.org
2022-01-04 11:14 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-16 21:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #5 from anlauf at gcc dot gnu.org ---
The following partial revert of r10-7334 avoids the ICE and restores the bug
in gcc-9:
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index bff1b35446f..245c4e1683f 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -5436,7 +5436,7 @@ gfc_resolve_ref (gfc_expr *expr)
case REF_INQUIRY:
/* Implement requirement in note 9.7 of F2018 that the result of the
LEN inquiry be a scalar. */
- if (ref->u.i == INQUIRY_LEN && array_ref && expr->ts.deferred)
+ if (ref->u.i == INQUIRY_LEN && array_ref)
{
array_ref->u.ar.type = AR_ELEMENT;
expr->rank = 0;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (4 preceding siblings ...)
2021-12-16 21:32 ` anlauf at gcc dot gnu.org
@ 2022-01-04 11:14 ` rguenth at gcc dot gnu.org
2022-01-17 12:44 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-04 11:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (5 preceding siblings ...)
2022-01-04 11:14 ` rguenth at gcc dot gnu.org
@ 2022-01-17 12:44 ` rguenth at gcc dot gnu.org
2022-06-28 10:47 ` [Bug fortran/103716] [10/11/12/13 " jakub at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 12:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (6 preceding siblings ...)
2022-01-17 12:44 ` rguenth at gcc dot gnu.org
@ 2022-06-28 10:47 ` jakub at gcc dot gnu.org
2023-05-23 5:46 ` [Bug fortran/103716] [10/11/12/13/14 " cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [10/11/12/13/14 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (7 preceding siblings ...)
2022-06-28 10:47 ` [Bug fortran/103716] [10/11/12/13 " jakub at gcc dot gnu.org
@ 2023-05-23 5:46 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:41 ` [Bug fortran/103716] [11/12/13/14 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-23 5:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #7 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:842a432b02238361ecc601d301ac400a7f30f4fa
commit r14-1082-g842a432b02238361ecc601d301ac400a7f30f4fa
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Tue May 23 06:46:37 2023 +0100
Fortran: Fix assumed length chars and len inquiry [PR103716]
2023-05-23 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/103716
* resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
element should be done for all characters without a len expr,
not just deferred lens, and for integer expressions.
* trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
set the se string_length to NULL_TREE.
gcc/testsuite/
PR fortran/103716
* gfortran.dg/pr103716.f90 : New test.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [11/12/13/14 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (8 preceding siblings ...)
2023-05-23 5:46 ` [Bug fortran/103716] [10/11/12/13/14 " cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:41 ` rguenth at gcc dot gnu.org
2023-07-08 19:08 ` [Bug fortran/103716] [11/12/13 " anlauf at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (9 preceding siblings ...)
2023-07-07 10:41 ` [Bug fortran/103716] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2023-07-08 19:08 ` anlauf at gcc dot gnu.org
2024-03-28 15:53 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-07-08 19:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (10 preceding siblings ...)
2023-07-08 19:08 ` [Bug fortran/103716] [11/12/13 " anlauf at gcc dot gnu.org
@ 2024-03-28 15:53 ` cvs-commit at gcc dot gnu.org
2024-03-28 15:56 ` pault at gcc dot gnu.org
2024-04-26 19:16 ` cvs-commit at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-28 15:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:
https://gcc.gnu.org/g:48d23749534ca96b3f0883579b44700a17e83d15
commit r13-8503-g48d23749534ca96b3f0883579b44700a17e83d15
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Tue May 23 06:46:37 2023 +0100
Fortran: Fix assumed length chars and len inquiry [PR103716]
2023-05-23 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/103716
* resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
element should be done for all characters without a len expr,
not just deferred lens, and for integer expressions.
* trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
set the se string_length to NULL_TREE.
gcc/testsuite/
PR fortran/103716
* gfortran.dg/pr103716.f90 : New test.
(cherry picked from commit 842a432b02238361ecc601d301ac400a7f30f4fa)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (11 preceding siblings ...)
2024-03-28 15:53 ` cvs-commit at gcc dot gnu.org
@ 2024-03-28 15:56 ` pault at gcc dot gnu.org
2024-04-26 19:16 ` cvs-commit at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: pault at gcc dot gnu.org @ 2024-03-28 15:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed on 13- and 14-branches. Closing.
Thanks for the report
Paul
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/103716] [11/12/13 Regression] ICE in gimplify_expr, at gimplify.c:15964 since r9-3803-ga5fbc2f36a291cbe
2021-12-14 18:11 [Bug fortran/103716] New: [10/11/12 Regression] ICE in gimplify_expr, at gimplify.c:15964 gscfq@t-online.de
` (12 preceding siblings ...)
2024-03-28 15:56 ` pault at gcc dot gnu.org
@ 2024-04-26 19:16 ` cvs-commit at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-26 19:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103716
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:b482968801158116dd8ba3b15a4c29143b2a423a
commit r12-10398-gb482968801158116dd8ba3b15a4c29143b2a423a
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Tue May 23 06:46:37 2023 +0100
Fortran: Fix assumed length chars and len inquiry [PR103716]
2023-05-23 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/103716
* resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
element should be done for all characters without a len expr,
not just deferred lens, and for integer expressions.
* trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
set the se string_length to NULL_TREE.
gcc/testsuite/
PR fortran/103716
* gfortran.dg/pr103716.f90 : New test.
(cherry picked from commit 842a432b02238361ecc601d301ac400a7f30f4fa)
^ permalink raw reply [flat|nested] 15+ messages in thread