public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547
@ 2021-11-24 17:47 gscfq@t-online.de
2021-11-24 21:54 ` [Bug fortran/103414] [PDT] " gscfq@t-online.de
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-11-24 17:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
Bug ID: 103414
Summary: [10/11/12 Regression] ICE in gfc_free_actual_arglist,
at fortran/expr.c:547
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Started with r10, between 20190630 and 20190728 :
$ cat z1.f90
program p
type t(n)
integer, kind :: n
character(n) :: c = ''
end type
type(t(3)) :: x = t(z'1')
end
$ cat z2.f90
program p
type t(n)
integer, kind :: n
character(n) :: c = ''
end type
type(t(3)) :: x(1) = [t(z'1')]
end
$ gfortran-12-20211121 -c z2.f90
z2.f90:6:33:
6 | type(t(3)) :: x(1) = [t(z'1')]
| 1
Error: The parameter expression at (1) must be of INTEGER type and not BOZ type
# hangs ...
$ gfortran-12-20211121 -c z1.f90
*** Error in `.../gcc/x86_64-pc-linux-gnu/12.0.0/f951': double free or
corruption (fasttop): 0x000000000298bdf0 ***
f951: internal compiler error: Aborted
0xd6009f crash_signal
../../gcc/toplev.c:322
0x79965c gfc_free_actual_arglist(gfc_actual_arglist*)
../../gcc/fortran/expr.c:547
0x788c66 gfc_match_data_decl()
../../gcc/fortran/decl.c:6340
0x7f3df3 match_word
../../gcc/fortran/parse.c:67
0x7f3df3 decode_statement
../../gcc/fortran/parse.c:378
0x7f583a next_free
../../gcc/fortran/parse.c:1397
0x7f583a next_statement
../../gcc/fortran/parse.c:1629
0x7f6f5b parse_spec
../../gcc/fortran/parse.c:4168
0x7fa2bc parse_progunit
../../gcc/fortran/parse.c:6179
0x7fb5a1 gfc_parse_file()
../../gcc/fortran/parse.c:6724
0x848a6f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:216
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
@ 2021-11-24 21:54 ` gscfq@t-online.de
2021-11-25 1:07 ` kargl at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-11-24 21:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
G. Steinmetz <gscfq@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[PDT] [10/11/12 Regression] |[PDT] ICE in
|ICE in |gfc_free_actual_arglist, at
|gfc_free_actual_arglist, at |fortran/expr.c:547
|fortran/expr.c:547 |
--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---
Right, primarily PDT specific.
Modified cases with deleted "z" should be treated first.
That changed with the PDT groundwork in r8 before 20180525.
$ cat z3.f90
program p
type t(n)
integer, kind :: n
character(n) :: c = ''
end type
type(t(3)) :: x = t('1')
end
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
2021-11-24 21:54 ` [Bug fortran/103414] [PDT] " gscfq@t-online.de
@ 2021-11-25 1:07 ` kargl at gcc dot gnu.org
2021-11-25 1:10 ` kargl at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-11-25 1:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
This one took a bit to find where to check for a BOZ.
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 705d2326a29..7add59f50bd 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1268,6 +1274,17 @@ resolve_structure_cons (gfc_expr *expr, int init)
else
resolve_fl_struct (expr->ts.u.derived);
+ /* Walk the constructor looking for an invalid BOZ. */
+ cons = gfc_constructor_first (expr->value.constructor);
+ for (; cons; cons = gfc_constructor_next (cons))
+ if (cons->expr && cons->expr->ts.type == BT_BOZ)
+ {
+ gfc_error ("boz-literal-constant at %L cannot appear as an "
+ "entity in a structure constructor",
+ &cons->expr->where);
+ return false;
+ }
+
/* If this is a Parameterized Derived Type template, find the
instance corresponding to the PDT kind parameters. */
if (expr->ts.u.derived->attr.pdt_template)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
2021-11-24 21:54 ` [Bug fortran/103414] [PDT] " gscfq@t-online.de
2021-11-25 1:07 ` kargl at gcc dot gnu.org
@ 2021-11-25 1:10 ` kargl at gcc dot gnu.org
2021-11-25 1:39 ` kargl at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-11-25 1:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
--- Comment #3 from kargl at gcc dot gnu.org ---
The patch in comment #2 does not address the issue in comment #1.
The patch only address an invalid BOZ in a structure constructor.
The issue in comment #1 is technical unrelated.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (2 preceding siblings ...)
2021-11-25 1:10 ` kargl at gcc dot gnu.org
@ 2021-11-25 1:39 ` kargl at gcc dot gnu.org
2021-11-25 9:56 ` [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954 marxin at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-11-25 1:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
--- Comment #4 from kargl at gcc dot gnu.org ---
This fixes/catches the type mismatch in the issue raised in comment #1.
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 705d2326a29..0a864da015b 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1231,9 +1237,17 @@ get_pdt_constructor (gfc_expr *expr, gfc_constructor
**constr,
if (!t)
return t;
}
- else if ((comp->attr.pdt_kind || comp->attr.pdt_len)
+ else if ((comp->attr.pdt_kind || comp->attr.pdt_len)
&& derived->attr.pdt_template)
{
+ if (comp->ts.type != cons->expr->ts.type)
+ {
+ gfc_error ("Type mismatch for a type parameter and an entity "
+ "at %L in the structure constructor",
+ &cons->expr->where);
+ return false;
+ }
+
t = get_pdt_spec_expr (comp, cons->expr);
if (!t)
return t;
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (3 preceding siblings ...)
2021-11-25 1:39 ` kargl at gcc dot gnu.org
@ 2021-11-25 9:56 ` marxin at gcc dot gnu.org
2021-11-25 9:59 ` [Bug fortran/103414] [10/11/12 Regression] " pinskia 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-25 9:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
Summary|[PDT] ICE in |[PDT] ICE in
|gfc_free_actual_arglist, at |gfc_free_actual_arglist, at
|fortran/expr.c:547 |fortran/expr.c:547 since
| |r10-2083-g8dc63166e0b85954
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-2083-g8dc63166e0b85954.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [10/11/12 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (4 preceding siblings ...)
2021-11-25 9:56 ` [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954 marxin at gcc dot gnu.org
@ 2021-11-25 9:59 ` pinskia at gcc dot gnu.org
2021-11-25 15:51 ` kargl at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-25 9:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[PDT] ICE in |[10/11/12 Regression] [PDT]
|gfc_free_actual_arglist, at |ICE in
|fortran/expr.c:547 since |gfc_free_actual_arglist, at
|r10-2083-g8dc63166e0b85954 |fortran/expr.c:547 since
| |r10-2083-g8dc63166e0b85954
Target Milestone|--- |10.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [10/11/12 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (5 preceding siblings ...)
2021-11-25 9:59 ` [Bug fortran/103414] [10/11/12 Regression] " pinskia at gcc dot gnu.org
@ 2021-11-25 15:51 ` kargl at gcc dot gnu.org
2022-06-28 10:47 ` [Bug fortran/103414] [10/11/12/13 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-11-25 15:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
--- Comment #6 from kargl at gcc dot gnu.org ---
(In reply to Martin Liška from comment #5)
> Started with r10-2083-g8dc63166e0b85954.
Well, no, it did not start with the above commit.
At best, it was exposed by this commit.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [10/11/12/13 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (6 preceding siblings ...)
2021-11-25 15:51 ` kargl at gcc dot gnu.org
@ 2022-06-28 10:47 ` jakub at gcc dot gnu.org
2022-06-28 14:57 ` kargl at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ 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=103414
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] 12+ messages in thread
* [Bug fortran/103414] [10/11/12/13 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (7 preceding siblings ...)
2022-06-28 10:47 ` [Bug fortran/103414] [10/11/12/13 " jakub at gcc dot gnu.org
@ 2022-06-28 14:57 ` kargl at gcc dot gnu.org
2023-06-30 8:38 ` [Bug fortran/103414] [10/11/12/13/14 " pault at gcc dot gnu.org
2023-07-07 10:41 ` [Bug fortran/103414] [11/12/13/14 " rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2022-06-28 14:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
--- Comment #8 from kargl at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #7)
> GCC 10.4 is being released, retargeting bugs to GCC 10.5.
That's a shame. The patches in comments in 2 and 4 where
submitted over 8 months ago.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [10/11/12/13/14 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (8 preceding siblings ...)
2022-06-28 14:57 ` kargl at gcc dot gnu.org
@ 2023-06-30 8:38 ` pault at gcc dot gnu.org
2023-07-07 10:41 ` [Bug fortran/103414] [11/12/13/14 " rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu.org @ 2023-06-30 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103414
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |pault at gcc dot gnu.org
Blocks| |82173
Last reconfirmed| |2023-06-30
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
Added to PDT meta-bug
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82173
[Bug 82173] [meta-bug] [PDT] Parameterized derived type errors
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/103414] [11/12/13/14 Regression] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
` (9 preceding siblings ...)
2023-06-30 8:38 ` [Bug fortran/103414] [10/11/12/13/14 " pault at gcc dot gnu.org
@ 2023-07-07 10:41 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ 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=103414
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-07-07 10:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 17:47 [Bug fortran/103414] New: [10/11/12 Regression] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 gscfq@t-online.de
2021-11-24 21:54 ` [Bug fortran/103414] [PDT] " gscfq@t-online.de
2021-11-25 1:07 ` kargl at gcc dot gnu.org
2021-11-25 1:10 ` kargl at gcc dot gnu.org
2021-11-25 1:39 ` kargl at gcc dot gnu.org
2021-11-25 9:56 ` [Bug fortran/103414] [PDT] ICE in gfc_free_actual_arglist, at fortran/expr.c:547 since r10-2083-g8dc63166e0b85954 marxin at gcc dot gnu.org
2021-11-25 9:59 ` [Bug fortran/103414] [10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-11-25 15:51 ` kargl at gcc dot gnu.org
2022-06-28 10:47 ` [Bug fortran/103414] [10/11/12/13 " jakub at gcc dot gnu.org
2022-06-28 14:57 ` kargl at gcc dot gnu.org
2023-06-30 8:38 ` [Bug fortran/103414] [10/11/12/13/14 " pault at gcc dot gnu.org
2023-07-07 10:41 ` [Bug fortran/103414] [11/12/13/14 " rguenth 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).