* [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567
[not found] <bug-83865-4@http.gcc.gnu.org/bugzilla/>
@ 2021-09-01 19:30 ` anlauf at gcc dot gnu.org
2024-06-02 20:36 ` anlauf at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-01 19:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83865
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #4 from anlauf at gcc dot gnu.org ---
As found in comment#0, it appears to be the array constructor for length 0
which is mishandled.
allocate (z, source=[ character(1) :: 'a']) ! works
allocate (z, source=[ character(0) :: 'a']) ! ICEs
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567
[not found] <bug-83865-4@http.gcc.gnu.org/bugzilla/>
2021-09-01 19:30 ` [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567 anlauf at gcc dot gnu.org
@ 2024-06-02 20:36 ` anlauf at gcc dot gnu.org
2024-06-03 20:13 ` anlauf at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-06-02 20:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83865
--- Comment #5 from anlauf at gcc dot gnu.org ---
The ICE is fixed by:
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index 9b497d6bdc6..605107b5168 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -6451,6 +6451,7 @@ gfc_trans_allocate (gfc_code * code, gfc_omp_namelist
*omp_allocate)
/* Special case when string in expr3 is zero. */
if (code->expr3->ts.type == BT_CHARACTER
+ && code->expr3->rank == 0
&& integer_zerop (se.string_length))
{
gfc_init_se (&se, NULL);
Needs further testing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567
[not found] <bug-83865-4@http.gcc.gnu.org/bugzilla/>
2021-09-01 19:30 ` [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567 anlauf at gcc dot gnu.org
2024-06-02 20:36 ` anlauf at gcc dot gnu.org
@ 2024-06-03 20:13 ` anlauf at gcc dot gnu.org
2024-06-04 17:15 ` cvs-commit at gcc dot gnu.org
2024-06-08 19:48 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-06-03 20:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83865
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
--- Comment #6 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2024-June/060544.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567
[not found] <bug-83865-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2024-06-03 20:13 ` anlauf at gcc dot gnu.org
@ 2024-06-04 17:15 ` cvs-commit at gcc dot gnu.org
2024-06-08 19:48 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-04 17:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83865
--- Comment #7 from GCC 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:7f21aee0d4ef95eee7d9f7f42e9a056715836648
commit r15-1018-g7f21aee0d4ef95eee7d9f7f42e9a056715836648
Author: Harald Anlauf <anlauf@gmx.de>
Date: Mon Jun 3 22:02:06 2024 +0200
Fortran: fix ALLOCATE with SOURCE=, zero-length character [PR83865]
gcc/fortran/ChangeLog:
PR fortran/83865
* trans-stmt.cc (gfc_trans_allocate): Restrict special case for
source-expression with zero-length character to rank 0, so that
the array shape is not discarded.
gcc/testsuite/ChangeLog:
PR fortran/83865
* gfortran.dg/allocate_with_source_32.f90: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/83865] ICE in wide_int_to_tree_1, at tree.c:1567
[not found] <bug-83865-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2024-06-04 17:15 ` cvs-commit at gcc dot gnu.org
@ 2024-06-08 19:48 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-08 19:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83865
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:c3e16edcf2c8429da2cb479d8941397f4300e0c4
commit r14-10291-gc3e16edcf2c8429da2cb479d8941397f4300e0c4
Author: Harald Anlauf <anlauf@gmx.de>
Date: Mon Jun 3 22:02:06 2024 +0200
Fortran: fix ALLOCATE with SOURCE=, zero-length character [PR83865]
gcc/fortran/ChangeLog:
PR fortran/83865
* trans-stmt.cc (gfc_trans_allocate): Restrict special case for
source-expression with zero-length character to rank 0, so that
the array shape is not discarded.
gcc/testsuite/ChangeLog:
PR fortran/83865
* gfortran.dg/allocate_with_source_32.f90: New test.
(cherry picked from commit 7f21aee0d4ef95eee7d9f7f42e9a056715836648)
^ permalink raw reply [flat|nested] 5+ messages in thread