* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
@ 2007-04-20 0:52 ` brooks at gcc dot gnu dot org
2007-07-08 17:27 ` dfranke at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-04-20 0:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from brooks at gcc dot gnu dot org 2007-04-20 01:52 -------
This is invalid code, since initialization expressions must be constants, and
the length of an assumed-length string argument is not a constant. Regardless,
we shouldn't be ICE'ing on it.
--
brooks at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |brooks at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-invalid-code
Known to fail| |4.1.2 4.3.0
Last reconfirmed|0000-00-00 00:00:00 |2007-04-20 01:52:43
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
2007-04-20 0:52 ` [Bug fortran/31639] " brooks at gcc dot gnu dot org
@ 2007-07-08 17:27 ` dfranke at gcc dot gnu dot org
2007-07-08 17:28 ` dfranke at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-08 17:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dfranke at gcc dot gnu dot org 2007-07-08 17:26 -------
Further reduced testcase:
$> cat pr31639.f90
function f()
integer :: i = irand()
f = i
end function
$> gfortran-svn -g -Wall -c pr31639.f90
pr31639.f90: In function 'f':
pr31639.f90:1: internal compiler error: in gfc_conv_constant, at
fortran/trans-const.c:297
With this code:
function f()
integer :: i = irand()
end function
one gets:
$> gfortran-svn -g -Wall -c pr31639.f90
pr31639.f90: In function 'f':
pr31639.f90:1: warning: Function return value not set
pr31639.f90:1: warning: control reaches end of non-void function
which is noteworthy in itself ...
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
2007-04-20 0:52 ` [Bug fortran/31639] " brooks at gcc dot gnu dot org
2007-07-08 17:27 ` dfranke at gcc dot gnu dot org
@ 2007-07-08 17:28 ` dfranke at gcc dot gnu dot org
2007-07-08 17:49 ` burnus at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-08 17:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dfranke at gcc dot gnu dot org 2007-07-08 17:28 -------
> function f()
> integer :: i = irand()
> end function
Make that:
function f()
integer :: f = irand()
end function
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (2 preceding siblings ...)
2007-07-08 17:28 ` dfranke at gcc dot gnu dot org
@ 2007-07-08 17:49 ` burnus at gcc dot gnu dot org
2007-07-12 22:15 ` dfranke at gcc dot gnu dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-08 17:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2007-07-08 17:49 -------
> function f()
> integer :: i = irand()
> f = i
> end function
We should give a message such as ifort:
The initialization shall not appear for this object name. [F]
This array or function or substring is invalid in constant expressions.
[IRAND]
The place to change is check_init_expr; maybe gfc_intrinsic_func_interface.
Giving an error should fix both problems.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (3 preceding siblings ...)
2007-07-08 17:49 ` burnus at gcc dot gnu dot org
@ 2007-07-12 22:15 ` dfranke at gcc dot gnu dot org
2007-07-22 16:32 ` dfranke at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-12 22:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dfranke at gcc dot gnu dot org 2007-07-12 22:15 -------
Subject: Bug 31639
Author: dfranke
Date: Thu Jul 12 22:15:11 2007
New Revision: 126605
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126605
Log:
gcc/fortran:
2007-07-12 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31639
* decl.c (gfc_match_suffix): Removed surplus general error that hides
a more specific message.
* resolve.c (resolve_fl_variable): Reject illegal initializiers only
if not already done.
(resolve_fl_procedure): Added check for initializers of functions.
gcc/testsuite:
2007-07-12 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31639
* gfortran.dg/func_decl_4.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/func_decl_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (4 preceding siblings ...)
2007-07-12 22:15 ` dfranke at gcc dot gnu dot org
@ 2007-07-22 16:32 ` dfranke at gcc dot gnu dot org
2007-07-22 16:39 ` dfranke at gcc dot gnu dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-22 16:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from dfranke at gcc dot gnu dot org 2007-07-22 16:31 -------
Subject: Bug 31639
Author: dfranke
Date: Sun Jul 22 16:31:11 2007
New Revision: 126826
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126826
Log:
gcc/fortran:
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962
PR fortran/31253
PR fortran/31265
PR fortran/31639
* gfortran.h (gfc_intrinsic_sym): Changed members elemental, pure,
generic, specific, actual_ok, noreturn into bits of a bitfield,
added bits for inquiry, transformational, conversion.
* check.c (non_init_transformational): Removed, removed all callers.
* intrinsic.c (enum class): New.
(add_sym*): Replaced argument elemetal by enum class. Changed all
callers.
(add_functions): Assign appropriate classes to intrinsic functions.
(add_subroutines): Assign appropriate classes to intrinsic subroutines.
(add_conv): Set conversion attribute.
(gfc_init_expr_extensions): Removed, removed all callers.
(gfc_intrinsic_func_interface): Reimplemented check for non-standard
initializatione expressions.
* expr.c (check_specification_function): New.
(gfc_is_constant_expr): Added check for specification functions.
(check_init_expr_arguments): New.
(check_inquiry): Changed return value to MATCH, added checks for
inquiry functions defined by F2003.
(check_transformational): New.
(check_null): New.
(check_elemental): New.
(check_conversion): New.
(check_init_expr): Call new check functions, add more specific error
messages.
gcc/testsuite:
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962
* gfortran.dg/array_initializer_1.f90: Removed warning.
* gfortran.dg/initialization_1.f90: Adjusted messages.
* gfortran.dg/nested_modules_6.f90: Removed warning.
PR fortran/31253
* gfortran.dg/initialization_7.f90: New test.
PR fortran/31639
* gfortran.dg/initialization_8.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/initialization_7.f90
trunk/gcc/testsuite/gfortran.dg/initialization_8.f90
Modified:
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/testsuite/gfortran.dg/array_initializer_1.f90
trunk/gcc/testsuite/gfortran.dg/initialization_1.f90
trunk/gcc/testsuite/gfortran.dg/nested_modules_6.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (5 preceding siblings ...)
2007-07-22 16:32 ` dfranke at gcc dot gnu dot org
@ 2007-07-22 16:39 ` dfranke at gcc dot gnu dot org
2007-07-22 16:41 ` dfranke at gcc dot gnu dot org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-22 16:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dfranke at gcc dot gnu dot org 2007-07-22 16:39 -------
Fixed in trunk. Closing.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.1.2 4.2.0 4.3.0 |4.1.2 4.2.0
Known to work| |4.3.0
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (6 preceding siblings ...)
2007-07-22 16:39 ` dfranke at gcc dot gnu dot org
@ 2007-07-22 16:41 ` dfranke at gcc dot gnu dot org
2007-07-22 18:53 ` debian-gcc at lists dot debian dot org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-22 16:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dfranke at gcc dot gnu dot org 2007-07-22 16:41 -------
As said, closing as fixed.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (7 preceding siblings ...)
2007-07-22 16:41 ` dfranke at gcc dot gnu dot org
@ 2007-07-22 18:53 ` debian-gcc at lists dot debian dot org
2007-07-22 19:14 ` kargl at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2007-07-22 18:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from debian-gcc at lists dot debian dot org 2007-07-22 18:53 -------
I don't know the fortran policy on closing bug reports with regressions; is
there no chance to backport the fix to the active branches?
Matthias
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (8 preceding siblings ...)
2007-07-22 18:53 ` debian-gcc at lists dot debian dot org
@ 2007-07-22 19:14 ` kargl at gcc dot gnu dot org
2007-07-22 19:42 ` dfranke at gcc dot gnu dot org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-07-22 19:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from kargl at gcc dot gnu dot org 2007-07-22 19:14 -------
(In reply to comment #9)
> I don't know the fortran policy on closing bug reports with regressions; is
> there no chance to backport the fix to the active branches?
It isn't a gfortran policy. The general GCC policy is that only regression
fixes can/should be backported. You would need to show that the code in
comment #1 could be compiled with a version of gfortran that is older than
4.1.2 20061115; otherwise, this is simply a bug that finally got fixed.
Additionally, there simply are too few gfortran developers to maintain 3
active branches. So, we have chosen to concentrate our effort on trunk.
If a patch fixes a regression in 4.2, it may be backported but there is
no guarantee.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (9 preceding siblings ...)
2007-07-22 19:14 ` kargl at gcc dot gnu dot org
@ 2007-07-22 19:42 ` dfranke at gcc dot gnu dot org
2007-07-23 20:35 ` dfranke at gcc dot gnu dot org
2007-07-23 20:46 ` dfranke at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-22 19:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from dfranke at gcc dot gnu dot org 2007-07-22 19:42 -------
Reopening, the original testcase still fails for std=gnu. Sigh.
For the record: an error is generated for -std=f95, std=f2003 and a warning for
-std=gnu -pedantic. Currently testing ...
Index: expr.c
===================================================================
--- expr.c (revision 126826)
+++ expr.c (working copy)
@@ -1966,9 +1966,8 @@
&& ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
&& ap->expr->symtree->n.sym->ts.cl->length == NULL)
{
- if (gfc_notify_std (GFC_STD_GNU, "assumed character length "
- "variable '%s' in constant expression at %L",
- e->symtree->n.sym->name, &e->where) == FAILURE)
+ gfc_error ("assumed character length variable '%s' in constant "
+ "expression at %L", e->symtree->n.sym->name, &e->where);
return MATCH_ERROR;
}
else if (not_restricted && check_init_expr (ap->expr) == FAILURE)
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (10 preceding siblings ...)
2007-07-22 19:42 ` dfranke at gcc dot gnu dot org
@ 2007-07-23 20:35 ` dfranke at gcc dot gnu dot org
2007-07-23 20:46 ` dfranke at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-23 20:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from dfranke at gcc dot gnu dot org 2007-07-23 20:35 -------
Subject: Bug 31639
Author: dfranke
Date: Mon Jul 23 20:35:03 2007
New Revision: 126858
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126858
Log:
gcc/fortran:
2007-07-23 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/31639
* expr.c (check_transformational): Reject valid transformational
intrinsics to avoid ICE.
(check_inquiry): Report error for assumed character lengths for
all supported standards.
(check_init_expr): Whitespace fix.
gcc/testsuite:
2007-07-23 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31639
* gfortran.dg/initialization_9.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/initialization_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/31639] [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len
2007-04-20 0:46 [Bug fortran/31639] New: [4.1/4.2/4.3] ICE in gfc_conv_constant, at fortran/trans-const.c:348 with len tbm at cyrius dot com
` (11 preceding siblings ...)
2007-07-23 20:35 ` dfranke at gcc dot gnu dot org
@ 2007-07-23 20:46 ` dfranke at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-23 20:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from dfranke at gcc dot gnu dot org 2007-07-23 20:45 -------
Closing again. The orginal testcase is now correctly handled for all standards.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31639
^ permalink raw reply [flat|nested] 14+ messages in thread