* [Bug fortran/103471] [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
@ 2021-11-30 7:03 ` rguenth at gcc dot gnu.org
2021-11-30 14:20 ` marxin at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-30 7:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
Priority|P3 |P4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
2021-11-30 7:03 ` [Bug fortran/103471] " rguenth at gcc dot gnu.org
@ 2021-11-30 14:20 ` marxin at gcc dot gnu.org
2021-12-23 0:35 ` kargl at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-30 14:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |markeggleston at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-11-30
Ever confirmed|0 |1
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r7-4028-g87c9fca50cbe7ca9, was fixed in r10-7369-gc38daa7976886a59
and started again in r11-693-g3ea6977d0f1813d9.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
2021-11-30 7:03 ` [Bug fortran/103471] " rguenth at gcc dot gnu.org
2021-11-30 14:20 ` marxin at gcc dot gnu.org
@ 2021-12-23 0:35 ` kargl at gcc dot gnu.org
2022-05-27 9:46 ` [Bug fortran/103471] [10/11/12/13 " rguenth at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-12-23 0:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
An error is being queued in symbol.c(gfc_set_default_type), but
error reporting has been disabled for some reason. Changing
gfc_error() to gfc_error_now() restores emitting the error
message, but is this correct!
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 179f6029ca3..43691710120 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -303,11 +303,11 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag,
gfc_namespace *ns)
{
const char *guessed = lookup_symbol_fuzzy (sym->name, sym);
if (guessed)
- gfc_error ("Symbol %qs at %L has no IMPLICIT type"
+ gfc_error_now ("Symbol %qs at %L has no IMPLICIT type"
"; did you mean %qs?",
sym->name, &sym->declared_at, guessed);
else
- gfc_error ("Symbol %qs at %L has no IMPLICIT type",
+ gfc_error_now ("Symbol %qs at %L has no IMPLICIT type",
sym->name, &sym->declared_at);
sym->attr.untyped = 1; /* Ensure we only give an error once. */
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [10/11/12/13 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (2 preceding siblings ...)
2021-12-23 0:35 ` kargl at gcc dot gnu.org
@ 2022-05-27 9:46 ` rguenth at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [10/11/12/13 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (3 preceding siblings ...)
2022-05-27 9:46 ` [Bug fortran/103471] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:47 ` jakub at gcc dot gnu.org
2023-07-07 10:41 ` [Bug fortran/103471] [11/12/13/14 " rguenth at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ 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=103471
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #4 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] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (4 preceding siblings ...)
2022-06-28 10:47 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:41 ` rguenth at gcc dot gnu.org
2024-04-11 17:34 ` pault at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ 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=103471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (5 preceding siblings ...)
2023-07-07 10:41 ` [Bug fortran/103471] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-04-11 17:34 ` pault at gcc dot gnu.org
2024-04-18 20:38 ` anlauf at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2024-04-11 17:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
The current mainline and 13-branches now power through to the fatal error at
trans-decl.cc:1800.
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (6 preceding siblings ...)
2024-04-11 17:34 ` pault at gcc dot gnu.org
@ 2024-04-18 20:38 ` anlauf at gcc dot gnu.org
2024-04-19 6:02 ` pault at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-04-18 20:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #7 from anlauf at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #6)
> The current mainline and 13-branches now power through to the fatal error at
> trans-decl.cc:1800.
True, but the location does not look nice:
pr103471.f90:1:9:
1 | program p
| 1
Fatal Error: k at (1) has no default type
compilation terminated.
With the following tentative - but otherwise untested - change:
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index e160c5c98c1..602f35f0cab 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -1797,7 +1797,9 @@ gfc_get_symbol_decl (gfc_symbol * sym)
}
if (sym->ts.type == BT_UNKNOWN)
- gfc_fatal_error ("%s at %C has no default type", sym->name);
+// gfc_fatal_error ("%s at %C has no default type", sym->name);
+ gfc_fatal_error ("%s at %L has no default type", sym->name,
+ &sym->declared_at);
if (sym->attr.intrinsic)
gfc_internal_error ("intrinsic variable which isn't a procedure");
we are back at:
pr103471.f90:3:21:
3 | print *, [real(x(k))]
| 1
Fatal Error: k at (1) has no default type
compilation terminated.
This looks more user friendly.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (7 preceding siblings ...)
2024-04-18 20:38 ` anlauf at gcc dot gnu.org
@ 2024-04-19 6:02 ` pault at gcc dot gnu.org
2024-04-19 6:02 ` pault at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2024-04-19 6:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> ---
> This looks more user friendly.
Also true. I have put it on to regtest but I think that it might be a good idea
to understand how the symbol evades resolution :-)
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (8 preceding siblings ...)
2024-04-19 6:02 ` pault at gcc dot gnu.org
@ 2024-04-19 6:02 ` pault at gcc dot gnu.org
2024-04-19 7:25 ` pault at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2024-04-19 6:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
> This looks more user friendly.
Also true. I have put it on to regtest but I think that it might be a good idea
to understand how the symbol evades resolution :-)
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (9 preceding siblings ...)
2024-04-19 6:02 ` pault at gcc dot gnu.org
@ 2024-04-19 7:25 ` pault at gcc dot gnu.org
2024-04-21 16:24 ` cvs-commit at gcc dot gnu.org
2024-04-21 16:34 ` [Bug fortran/103471] Missed no IMPLICIT type errors pault at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2024-04-19 7:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
--- Comment #10 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #9)
> > This looks more user friendly.
>
> Also true. I have put it on to regtest but I think that it might be a good
> idea to understand how the symbol evades resolution :-)
>
> Paul
It regtests OK.
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (10 preceding siblings ...)
2024-04-19 7:25 ` pault at gcc dot gnu.org
@ 2024-04-21 16:24 ` cvs-commit at gcc dot gnu.org
2024-04-21 16:34 ` [Bug fortran/103471] Missed no IMPLICIT type errors pault at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-21 16:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
--- Comment #11 from GCC 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:f17d31e709af9b2d488adecd6cd040dfc1f23b04
commit r14-10059-gf17d31e709af9b2d488adecd6cd040dfc1f23b04
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Sun Apr 21 17:24:24 2024 +0100
Fortran: Detect 'no implicit type' error in right place [PR103471]
2024-04-21 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/103471
* resolve.cc (resolve_actual_arglist): Catch variables silently
set as untyped, resetting the flag so that gfc_resolve_expr can
generate the no implicit type error.
(gfc_resolve_index_1): Block index expressions of unknown type
from being converted to default integer, avoiding the fatal
error in trans-decl.cc.
* symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
'no IMPLICIT type' error message.
* trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
to that of the symbol declaration.
(gfc_trans_deferred_vars): Remove two trailing tabs.
gcc/testsuite/
PR fortran/103471
* gfortran.dg/pr103471.f90: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/103471] Missed no IMPLICIT type errors
2021-11-29 18:48 [Bug fortran/103471] New: [9/10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 gscfq@t-online.de
` (11 preceding siblings ...)
2024-04-21 16:24 ` cvs-commit at gcc dot gnu.org
@ 2024-04-21 16:34 ` pault at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2024-04-21 16:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103471
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12/13/14 Regression] |Missed no IMPLICIT type
|ICE in |errors
|gfc_typenode_for_spec, at |
|fortran/trans-types.c:1114 |
--- Comment #12 from Paul Thomas <pault at gcc dot gnu.org> ---
The regression has been cured in the above commit and some of the missed error
messages have been fixed.
Compared with the submission to the list and discussed with Harald Anlauf, an
extra chunk has been added in resolve.cc(resolve_actual_arglist) to catch
untyped actual arguments.
See the testcase commented out line for an example interference between
different statements with untyped symbols.
I am keeping this one open having changed the summary.
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread