public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE
@ 2008-06-09 14:05 walter dot zimmer at dlr dot de
2008-06-09 16:41 ` [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement burnus at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: walter dot zimmer at dlr dot de @ 2008-06-09 14:05 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]
The following code triggers an ICE even with gfortran 4.3.1:
=================================================================
bash$ gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.3.1/configure --with-pkgversion='DLR MF/AP UPAS
2008-06-09' --with-bugurl=walter.zimmer@dlr.de --prefix=/local/upas/inst-devel
--enable-languages=c,c++,fortran
--with-gmp-include=/local/upas/compile/gmp-4.2.2
--with-gmp-lib=/local/upas/compile/gmp-4.2.2/.libs
--with-mpfr-include=/local/upas/compile/mpfr-2.3.1
--with-mpfr-lib=/local/upas/compile/mpfr-2.3.1/.libs
Thread model: posix
gcc version 4.3.1 (DLR MF/AP UPAS 2008-06-09)
bash$ cat funny.F
SUBROUTINE FUNNY_STRINGS
character*256 STRING
CHARACTER (len=*) MY_STRING(1:3)
PARAMETER ( MY_STRING = (/ "A" , "B", "C" /) )
STRING = MY_STRING(1)
RETURN
END
bash$ gfortran -c funny.F
funny.F: In function funny_strings:
funny.F:1: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:1031
=================================================================
I suspect this is valid code, but at the end this is not the point as an ICE
should not happen here.
Maybe it's related to bug id 36322, as an array is also used there, but the
line number in gfc_get_symbol_decl is different, so I suspect not.
This ICE is also triggered with gfortran 4.3.0 and 4.1.2.
--
Summary: Fortran CHARACTER array triggers ICE
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: walter dot zimmer at dlr dot de
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
@ 2008-06-09 16:41 ` burnus at gcc dot gnu dot org
2008-06-10 8:12 ` walter dot zimmer at dlr dot de
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-09 16:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2008-06-09 16:40 -------
CONFIRM. The failing assert is:
gcc_assert (!sym->value);
Work around: Use the following syntax
CHARACTER (len=*), PARAMETER :: MY_STRING(1:3) = (/ "A" , "B", "C" /)
or explicitly give the length of the character length:
CHARACTER (len=1) MY_STRING(1:3)
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|x86_64-unknown-linux-gnu |
GCC host triplet|x86_64-unknown-linux-gnu |
GCC target triplet|x86_64-unknown-linux-gnu |
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2008-06-09 16:40:32
date| |
Summary|Fortran CHARACTER array |ICE: len=* CHARACTER array
|triggers ICE |with separate PARAMETER
| |statement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
2008-06-09 16:41 ` [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement burnus at gcc dot gnu dot org
@ 2008-06-10 8:12 ` walter dot zimmer at dlr dot de
2008-06-12 18:33 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: walter dot zimmer at dlr dot de @ 2008-06-10 8:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from walter dot zimmer at dlr dot de 2008-06-10 08:11 -------
The workaround works fine, many thanks!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
2008-06-09 16:41 ` [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement burnus at gcc dot gnu dot org
2008-06-10 8:12 ` walter dot zimmer at dlr dot de
@ 2008-06-12 18:33 ` burnus at gcc dot gnu dot org
2008-06-12 19:27 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-12 18:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2008-06-12 18:32 -------
Created an attachment (id=15758)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15758&action=view)
Patch; TODO: Create test cases (incl. for kind=4)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
` (2 preceding siblings ...)
2008-06-12 18:33 ` burnus at gcc dot gnu dot org
@ 2008-06-12 19:27 ` burnus at gcc dot gnu dot org
2008-06-13 13:05 ` burnus at gcc dot gnu dot org
2008-06-13 13:15 ` burnus at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-12 19:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2008-06-12 19:26 -------
> TODO: Create test cases (incl. for kind=4)
And with -std=f95: checking for equal string lengths. Also the initialization
by an other parameter should be checked. I will work on a test case in the next
days.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |burnus at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2008-06-09 16:40:32 |2008-06-12 19:26:48
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
` (3 preceding siblings ...)
2008-06-12 19:27 ` burnus at gcc dot gnu dot org
@ 2008-06-13 13:05 ` burnus at gcc dot gnu dot org
2008-06-13 13:15 ` burnus at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-13 13:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2008-06-13 13:05 -------
Subject: Bug 36476
Author: burnus
Date: Fri Jun 13 13:04:26 2008
New Revision: 136754
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136754
Log:
2008-06-13 Tobias Burnus <burnus@net-b.de>
PR fortran/36476
* decl.c (do_parm): Handle init expression for len=*.
2008-06-13 Tobias Burnus <burnus@net-b.de>
PR fortran/36476
* gfortran.dg/parameter_array_init_4.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/parameter_array_init_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
` (4 preceding siblings ...)
2008-06-13 13:05 ` burnus at gcc dot gnu dot org
@ 2008-06-13 13:15 ` burnus at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-13 13:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from burnus at gcc dot gnu dot org 2008-06-13 13:14 -------
FIXED on the trunk (4.4.0).
Thanks for the report.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36476
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-06-13 13:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-09 14:05 [Bug fortran/36476] New: Fortran CHARACTER array triggers ICE walter dot zimmer at dlr dot de
2008-06-09 16:41 ` [Bug fortran/36476] ICE: len=* CHARACTER array with separate PARAMETER statement burnus at gcc dot gnu dot org
2008-06-10 8:12 ` walter dot zimmer at dlr dot de
2008-06-12 18:33 ` burnus at gcc dot gnu dot org
2008-06-12 19:27 ` burnus at gcc dot gnu dot org
2008-06-13 13:05 ` burnus at gcc dot gnu dot org
2008-06-13 13:15 ` burnus at gcc dot gnu dot 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).