* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
@ 2013-01-25 16:30 ` janus at gcc dot gnu.org
2013-01-25 17:13 ` dominiq at lps dot ens.fr
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-01-25 16:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code
Last reconfirmed| |2013-01-25
CC| |janus at gcc dot gnu.org
Ever Confirmed|0 |1
Summary|internal compiler error: in |[4.6/4.7/4.8 Regression]
|gfc_get_symbol_decl, at |ICE with -fno-automatic
|fortran/trans-decl.c:1418 |-finit-local-zero
--- Comment #1 from janus at gcc dot gnu.org 2013-01-25 16:30:22 UTC ---
Confirmed. Fails with 4.6, 4.7 and trunk, while it works at least with 4.3.
Reduced/modified test case:
subroutine cchaine (i)
implicit none
integer :: i
character(len=i) :: chaine
write(*,*) chaine
end subroutine
Backtrace on trunk:
internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1441
subroutine cchaine (i)
^
0x6500e4 gfc_get_symbol_decl(gfc_symbol*)
/home/jweil/gcc48/trunk/gcc/fortran/trans-decl.c:1441
0x65b9e6 generate_local_decl
/home/jweil/gcc48/trunk/gcc/fortran/trans-decl.c:4601
0x611b36 do_traverse_symtree
/home/jweil/gcc48/trunk/gcc/fortran/symbol.c:3449
0x611c02 gfc_traverse_ns(gfc_namespace*, void (*)(gfc_symbol*))
/home/jweil/gcc48/trunk/gcc/fortran/symbol.c:3474
0x65c020 generate_local_vars
/home/jweil/gcc48/trunk/gcc/fortran/trans-decl.c:4760
0x65dad4 gfc_generate_function_code(gfc_namespace*)
/home/jweil/gcc48/trunk/gcc/fortran/trans-decl.c:5334
0x62ea00 gfc_generate_code(gfc_namespace*)
/home/jweil/gcc48/trunk/gcc/fortran/trans.c:1705
0x5cdff5 translate_all_program_units
/home/jweil/gcc48/trunk/gcc/fortran/parse.c:4463
0x5ce65b gfc_parse_file()
/home/jweil/gcc48/trunk/gcc/fortran/parse.c:4677
0x61adad gfc_be_parse_file
/home/jweil/gcc48/trunk/gcc/fortran/f95-lang.c:189
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
2013-01-25 16:30 ` [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero janus at gcc dot gnu.org
@ 2013-01-25 17:13 ` dominiq at lps dot ens.fr
2013-01-25 17:21 ` dominiq at lps dot ens.fr
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-01-25 17:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-01-25 17:12:52 UTC ---
Revision 183136 (2012-01-12) is OK; revision 183306 (2012-01-19) gives the ICE.
This is due to a change made on 4.7 and backported to 4.6.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
2013-01-25 16:30 ` [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero janus at gcc dot gnu.org
2013-01-25 17:13 ` dominiq at lps dot ens.fr
@ 2013-01-25 17:21 ` dominiq at lps dot ens.fr
2013-02-08 15:43 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-01-25 17:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-01-25 17:21:14 UTC ---
I'll bet on r183180 (pr51800). CCed Tobias.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (2 preceding siblings ...)
2013-01-25 17:21 ` dominiq at lps dot ens.fr
@ 2013-02-08 15:43 ` rguenth at gcc dot gnu.org
2013-02-08 22:02 ` janus at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-08 15:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |4.6.4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (3 preceding siblings ...)
2013-02-08 15:43 ` rguenth at gcc dot gnu.org
@ 2013-02-08 22:02 ` janus at gcc dot gnu.org
2013-02-08 22:57 ` janus at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-02-08 22:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #4 from janus at gcc dot gnu.org 2013-02-08 22:02:09 UTC ---
The following, which is a partial revert of r183180, fixes the ICE:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 195813)
+++ gcc/fortran/resolve.c (working copy)
@@ -10981,26 +10981,6 @@ build_default_init_expr (gfc_symbol *sym)
gfc_free_expr (init_expr);
init_expr = NULL;
}
- if (!init_expr && gfc_option.flag_init_character ==
GFC_INIT_CHARACTER_ON
- && sym->ts.u.cl->length)
- {
- gfc_actual_arglist *arg;
- init_expr = gfc_get_expr ();
- init_expr->where = sym->declared_at;
- init_expr->ts = sym->ts;
- init_expr->expr_type = EXPR_FUNCTION;
- init_expr->value.function.isym =
- gfc_intrinsic_function_by_id (GFC_ISYM_REPEAT);
- init_expr->value.function.name = "repeat";
- arg = gfc_get_actual_arglist ();
- arg->expr = gfc_get_character_expr (sym->ts.kind, &sym->declared_at,
- NULL, 1);
- arg->expr->value.character.string[0]
- = gfc_option.flag_init_character_value;
- arg->next = gfc_get_actual_arglist ();
- arg->next->expr = gfc_copy_expr (sym->ts.u.cl->length);
- init_expr->value.function.actual = arg;
- }
break;
default:
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (4 preceding siblings ...)
2013-02-08 22:02 ` janus at gcc dot gnu.org
@ 2013-02-08 22:57 ` janus at gcc dot gnu.org
2013-02-09 15:34 ` janus at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-02-08 22:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #5 from janus at gcc dot gnu.org 2013-02-08 22:57:15 UTC ---
(In reply to comment #4)
> The following, which is a partial revert of r183180, fixes the ICE:
However, it fails on init_flag_9.f90, which the following version does not:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 195813)
+++ gcc/fortran/resolve.c (working copy)
@@ -10982,7 +10982,7 @@ build_default_init_expr (gfc_symbol *sym)
init_expr = NULL;
}
if (!init_expr && gfc_option.flag_init_character ==
GFC_INIT_CHARACTER_ON
- && sym->ts.u.cl->length)
+ && sym->ts.u.cl->length && gfc_option.flag_max_stack_var_size != 0)
{
gfc_actual_arglist *arg;
init_expr = gfc_get_expr ();
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.6/4.7/4.8 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (5 preceding siblings ...)
2013-02-08 22:57 ` janus at gcc dot gnu.org
@ 2013-02-09 15:34 ` janus at gcc dot gnu.org
2013-04-12 15:16 ` [Bug fortran/55907] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-02-09 15:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #6 from janus at gcc dot gnu.org 2013-02-09 15:34:34 UTC ---
The patch in comment 5 regtests cleanly!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (6 preceding siblings ...)
2013-02-09 15:34 ` janus at gcc dot gnu.org
@ 2013-04-12 15:16 ` jakub at gcc dot gnu.org
2013-06-16 14:27 ` dominiq at lps dot ens.fr
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 15:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.6.4 |4.7.4
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 15:15:56 UTC ---
GCC 4.6.4 has been released and the branch has been closed.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (7 preceding siblings ...)
2013-04-12 15:16 ` [Bug fortran/55907] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
@ 2013-06-16 14:27 ` dominiq at lps dot ens.fr
2014-01-16 20:12 ` law at redhat dot com
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-16 14:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> The patch in comment 5 regtests cleanly!
Confirmed. Any reason why it has not been committed?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (8 preceding siblings ...)
2013-06-16 14:27 ` dominiq at lps dot ens.fr
@ 2014-01-16 20:12 ` law at redhat dot com
2014-02-17 12:47 ` janus at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: law at redhat dot com @ 2014-01-16 20:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #9 from Jeffrey A. Law <law at redhat dot com> ---
Janus -- you have a patch in this BZ which apparently fixes this problem, seems
like low hanging fruit.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (9 preceding siblings ...)
2014-01-16 20:12 ` law at redhat dot com
@ 2014-02-17 12:47 ` janus at gcc dot gnu.org
2014-02-19 7:39 ` janus at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-17 12:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #10 from janus at gcc dot gnu.org ---
Author: janus
Date: Mon Feb 17 12:46:52 2014
New Revision: 207823
URL: http://gcc.gnu.org/viewcvs?rev=207823&root=gcc&view=rev
Log:
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* resolve.c (build_default_init_expr): Don't initialize character
variable if -fno-automatic is given.
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* gfortran.dg/init_flag_12.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/init_flag_12.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (10 preceding siblings ...)
2014-02-17 12:47 ` janus at gcc dot gnu.org
@ 2014-02-19 7:39 ` janus at gcc dot gnu.org
2014-02-20 8:01 ` janus at gcc dot gnu.org
2014-02-20 8:02 ` janus at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-19 7:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #11 from janus at gcc dot gnu.org ---
Author: janus
Date: Wed Feb 19 07:38:45 2014
New Revision: 207876
URL: http://gcc.gnu.org/viewcvs?rev=207876&root=gcc&view=rev
Log:
2014-02-19 Janus Weil <janus@gcc.gnu.org>
Backports from mainline:
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* resolve.c (build_default_init_expr): Don't initialize character
variable if -fno-automatic is given.
2014-02-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/60231
* resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy
arguments to prevent ICE.
2014-02-19 Janus Weil <janus@gcc.gnu.org>
Backports from mainline:
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* gfortran.dg/init_flag_12.f90: New.
2014-02-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/60231
* gfortran.dg/typebound_generic_15.f90: New.
Added:
branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/init_flag_12.f90
branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/typebound_generic_15.f90
Modified:
branches/gcc-4_8-branch/gcc/fortran/ChangeLog
branches/gcc-4_8-branch/gcc/fortran/resolve.c
branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (11 preceding siblings ...)
2014-02-19 7:39 ` janus at gcc dot gnu.org
@ 2014-02-20 8:01 ` janus at gcc dot gnu.org
2014-02-20 8:02 ` janus at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-20 8:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
--- Comment #12 from janus at gcc dot gnu.org ---
Author: janus
Date: Thu Feb 20 08:00:48 2014
New Revision: 207935
URL: http://gcc.gnu.org/viewcvs?rev=207935&root=gcc&view=rev
Log:
2014-02-20 Janus Weil <janus@gcc.gnu.org>
Backport from mainline
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* resolve.c (build_default_init_expr): Don't initialize character
variable if -fno-automatic is given.
2014-02-20 Janus Weil <janus@gcc.gnu.org>
Backport from mainline
2014-02-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/55907
* gfortran.dg/init_flag_12.f90: New.
Added:
branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/init_flag_12.f90
Modified:
branches/gcc-4_7-branch/gcc/fortran/ChangeLog
branches/gcc-4_7-branch/gcc/fortran/resolve.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/55907] [4.7/4.8/4.9 Regression] ICE with -fno-automatic -finit-local-zero
2013-01-08 6:56 [Bug fortran/55907] New: internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1418 garcia.espinosa.jr at gmail dot com
` (12 preceding siblings ...)
2014-02-20 8:01 ` janus at gcc dot gnu.org
@ 2014-02-20 8:02 ` janus at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-20 8:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55907
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #13 from janus at gcc dot gnu.org ---
Fixed for 4.9.0, 4.8.3 and 4.7.4. Closing.
^ permalink raw reply [flat|nested] 15+ messages in thread