public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-12 11:58 ` jakub at gcc dot gnu.org
2020-04-08 14:45 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.3 |9.4
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830 jakub at gcc dot gnu.org
@ 2020-04-08 14:45 ` burnus at gcc dot gnu.org
2021-06-01 8:15 ` [Bug fortran/93339] [9/10/11/12 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-04-08 14:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Created attachment 48243
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48243&action=edit
Extended test case
I have tried with GCC 7 – while some variants to not crash, others do and it
also does not work at run time. The full test case shows the same compile-time
error as trunk (see last item in this comment). Hence, it is not a "real"
regression.
* * *
The problem is at
associate (y => x%a)
here,
expr = "x%a"
but
expr->ts.u.cl->backend_decl == ".z".
When processing "associate (y => x%a)", gfc_get_array_span() gets the
descriptor (desc) and the "expr" from above as input. (When called from
trans_associate_var.)
Thus, one ends up with:
integer(kind=8) .y;
struct array01_unknown y;
y = x.a;
y.span = .z; // should be .y instead (+ at some point initialized)
If one uses "y => x%a(:)(1:3)", one gets:
.z = 3
Hence, .z is no longer uninitialized. Still, '.z' is not defined in this scope
→ which causes the ICE.
If one only has only one ASSOCIATE, this works has there is only a '.y'.
In the attached test case (when commenting the two inner associate):
'y = x%a(:)(1:3)' works
but 'y2 => x%a' fails at the run-time check as 'y == ['AB','CD'] instead of
['ABC','DEF'] (why?)
* * *
Additionally, there are odd errors for the inner associate, which does not show
up for the outer associate; it might be well related to the expr->ts.u.cl
issue, but could also be an issue of its own.
associate (z => x%a(:)(1:2))
1
Error: Substring end index at (1) exceeds the string length
foo3.f90:18:31:
associate (z => x%a(:)(1:2))
1
Error: Entity ‘z’ at (1) has a deferred type parameter and requires either the
POINTER or ALLOCATABLE attribute
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/93339] [9/10/11/12 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830 jakub at gcc dot gnu.org
2020-04-08 14:45 ` burnus at gcc dot gnu.org
@ 2021-06-01 8:15 ` rguenth at gcc dot gnu.org
2022-05-27 9:41 ` [Bug fortran/93339] [10/11/12/13 " rguenth at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01 8:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.4 |9.5
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/93339] [10/11/12/13 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2021-06-01 8:15 ` [Bug fortran/93339] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2022-05-27 9:41 ` rguenth at gcc dot gnu.org
2022-06-28 10:39 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/93339] [10/11/12/13 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2022-05-27 9:41 ` [Bug fortran/93339] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:39 ` jakub at gcc dot gnu.org
2023-04-08 8:04 ` cvs-commit at gcc dot gnu.org
2023-04-08 9:32 ` pault at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #7 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] 7+ messages in thread
* [Bug fortran/93339] [10/11/12/13 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2022-06-28 10:39 ` jakub at gcc dot gnu.org
@ 2023-04-08 8:04 ` cvs-commit at gcc dot gnu.org
2023-04-08 9:32 ` pault at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-08 8:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
--- Comment #8 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:eac493851f07df98213ecf67a5e9ab41a7babcd2
commit r13-7121-geac493851f07df98213ecf67a5e9ab41a7babcd2
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Sat Apr 8 09:04:13 2023 +0100
Fortran: Fix some of the bugs in associate [PR87477]
2023-04-08 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/87477
* iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
string length is deferred use the string typespec for result.
* resolve.cc (resolve_assoc_var): Handle parentheses around the
target expression.
(resolve_block_construct): Remove unnecessary static decls.
* trans-array.cc (gfc_conv_expr_descriptor): Guard string len
expression in condition. Improve handling of string length and
span, especially for substrings of the descriptor.
(duplicate_allocatable): Make element type more explicit with
'eltype'.
* trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
appropriate message instead of ICE if symbol type is unknown.
(gfc_generate_function_code): Set current locus to proc_sym
declared_at.
* trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
'previous' and use if end expression in substring reference is
null.
(gfc_conv_string_length): Use gfc_conv_expr_descriptor if
'expr_flat' is an array. Add post block to catch deallocation
of temporaries.
(gfc_conv_procedure_call): Assign the parmse string length to
the expression string length, if it is deferred.
(gfc_trans_alloc_subarray_assign): If this is a deferred string
length component, store the string length in the hidden comp.
Update the typespec length accordingly. Generate a new type
spec for the call to gfc_duplicate-allocatable in this case.
* trans-io.cc (gfc_trans_transfer): Scalarize transfer of
deferred character array components.
gcc/testsuite/
PR fortran/87477
* gfortran.dg/associate_47.f90 : Enable substring test.
* gfortran.dg/associate_51.f90 : Update an error message.
* gfortran.dg/goacc/array-with-dt-2.f90 : Add span to
uninitialzed dg-warnings.
PR fortran/85686
PR fortran/88247
PR fortran/91941
PR fortran/92779
PR fortran/93339
PR fortran/93813
PR fortran/100948
PR fortran/102106
* gfortran.dg/associate_60.f90 : New test
PR fortran/98408
* gfortran.dg/pr98408.f90 : New test
PR fortran/105205
* gfortran.dg/pr105205.f90 : New test
PR fortran/106918
* gfortran.dg/pr106918.f90 : New test
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/93339] [10/11/12/13 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2023-04-08 8:04 ` cvs-commit at gcc dot gnu.org
@ 2023-04-08 9:32 ` pault at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu.org @ 2023-04-08 9:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93339
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed on mainline
Thanks for the report
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-04-08 9:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-93339-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug fortran/93339] [9/10 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2830 jakub at gcc dot gnu.org
2020-04-08 14:45 ` burnus at gcc dot gnu.org
2021-06-01 8:15 ` [Bug fortran/93339] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-05-27 9:41 ` [Bug fortran/93339] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:39 ` jakub at gcc dot gnu.org
2023-04-08 8:04 ` cvs-commit at gcc dot gnu.org
2023-04-08 9:32 ` 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).