public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666
@ 2006-11-13 21:30 anlauf at gmx dot de
2006-11-13 21:31 ` [Bug fortran/29821] " anlauf at gmx dot de
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: anlauf at gmx dot de @ 2006-11-13 21:30 UTC (permalink / raw)
To: gcc-bugs
Hi,
here's another one:
gfcbug45.f90: In function 'foo':
gfcbug45.f90:8: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:666
Sample code attached.
Enough for tonight...
--
Summary: ICE in gfc_typenode_for_spec, at fortran/trans-
types.c:666
ans-types.c:666
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anlauf at gmx dot de
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
@ 2006-11-13 21:31 ` anlauf at gmx dot de
2006-11-13 21:40 ` burnus at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gmx dot de @ 2006-11-13 21:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from anlauf at gmx dot de 2006-11-13 21:31 -------
Created an attachment (id=12612)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12612&action=view)
ICE demo code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
2006-11-13 21:31 ` [Bug fortran/29821] " anlauf at gmx dot de
@ 2006-11-13 21:40 ` burnus at gcc dot gnu dot org
2006-11-14 6:31 ` [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666 fxcoudert at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-13 21:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2006-11-13 21:39 -------
Slightly reduced test case:
module gfcbug45
implicit none
type cartesian
real :: x(2)
end type cartesian
contains
subroutine foo (z)
type(cartesian), intent(in) :: z
integer :: i
real :: a
real, parameter :: eps(2) = (/ 1, 2 /)
i = 1
a = sum (eps(i:2) * z%x(1:2))
end subroutine foo
end module gfcbug45
#1 0x00000000004956f7 in gfc_typenode_for_spec (spec=<value optimized out>)
at fortran/trans-types.c:666
#2 0x0000000000495d55 in gfc_sym_type (sym=0xde0be0) at
fortran/trans-types.c:1316
#3 0x0000000000496265 in gfc_get_function_type (sym=0xde0be0) at
fortran/trans-types.c:1781
#4 0x000000000047405e in gfc_get_extern_function_decl (sym=0xde0be0) at
fortran/trans-decl.c:1125
#5 0x000000000047ab54 in gfc_conv_function_val (se=0x7fff1a23f3a0,
sym=0xde0be0) at fortran/trans-expr.c:1222
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2006-11-13 21:39:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
2006-11-13 21:31 ` [Bug fortran/29821] " anlauf at gmx dot de
2006-11-13 21:40 ` burnus at gcc dot gnu dot org
@ 2006-11-14 6:31 ` fxcoudert at gcc dot gnu dot org
2006-11-14 21:24 ` pault at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-11-14 6:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2006-11-14 06:31 -------
Still more reduced testcase:
module gfcbug45
implicit none
contains
subroutine foo
integer :: i
real :: a
real, parameter :: eps(1) = (/ 1 /)
i = 1
a = sum (eps(i:i) * eps)
end subroutine foo
end module gfcbug45
If the "implicit none" or the "module ... end module" is removed, the ICE goes
away. Probably worth running using a non-optimized front-end under valgrind.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Last reconfirmed|2006-11-13 21:39:59 |2006-11-14 06:31:49
date| |
Summary|ICE in |ICE in
|gfc_typenode_for_spec, at |gfc_typenode_for_spec, at
|fortran/trans-types.c:666 |fortran/trans-
|ans-types.c:666 |types.c:666ans-types.c:666
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (2 preceding siblings ...)
2006-11-14 6:31 ` [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666 fxcoudert at gcc dot gnu dot org
@ 2006-11-14 21:24 ` pault at gcc dot gnu dot org
2006-11-14 21:48 ` pault at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-14 21:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pault at gcc dot gnu dot org 2006-11-14 21:24 -------
>
> If the "implicit none" or the "module ... end module" is removed, the ICE goes
> away. Probably worth running using a non-optimized front-end under valgrind.
>
or replacing a = sum (eps(i:i) * eps)
by
a = sum (eps * eps)
a = sum (eps(1:1) * eps)
a = sum (eps(i:i))
also remove the problem
integer, parameter :: i = 1
and removing the assinment to i, does likewise.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (3 preceding siblings ...)
2006-11-14 21:24 ` pault at gcc dot gnu dot org
@ 2006-11-14 21:48 ` pault at gcc dot gnu dot org
2006-11-17 16:22 ` pault at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-14 21:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2006-11-14 21:48 -------
It gets better and better...
module gfcbug45
implicit none
contains
subroutine foo
integer :: i
real :: a
real, parameter :: eps(1) = (/ 1 /)
i = 1
a = mysum (eps(i:i) * eps)
end subroutine foo
real function mysum (x)
real :: x(:)
mysum = sum(x)
end function mysum
end module gfcbug45
works just fine.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (4 preceding siblings ...)
2006-11-14 21:48 ` pault at gcc dot gnu dot org
@ 2006-11-17 16:22 ` pault at gcc dot gnu dot org
2006-12-04 19:30 ` pault at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-17 16:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pault at gcc dot gnu dot org 2006-11-17 16:22 -------
A patch is on its way - the error is in expr.c(find_array_section); the code
presently returns FAILURE if the elements of the array section are not
constant. This is not correct for any of the simplify functions, which should
return SUCCESS even if simplification has not occurred - FAILURE is reserved
for errors.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2006-11-14 06:31:49 |2006-11-17 16:22:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (5 preceding siblings ...)
2006-11-17 16:22 ` pault at gcc dot gnu dot org
@ 2006-12-04 19:30 ` pault at gcc dot gnu dot org
2006-12-09 15:18 ` [Bug fortran/29821] [4.2 and 4.1] " pault at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-04 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pault at gcc dot gnu dot org 2006-12-04 19:30 -------
Subject: Bug 29821
Author: pault
Date: Mon Dec 4 19:30:33 2006
New Revision: 119504
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119504
Log:
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
* resolve.c (resolve_operator): Only return result of
gfc_simplify_expr if expression is constant.
2006-12-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
* gfortran.dg/parameter_array_section_1.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/parameter_array_section_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] [4.2 and 4.1] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (6 preceding siblings ...)
2006-12-04 19:30 ` pault at gcc dot gnu dot org
@ 2006-12-09 15:18 ` pault at gcc dot gnu dot org
2006-12-09 15:20 ` [Bug fortran/29821] [4.1 only] " pault at gcc dot gnu dot org
2006-12-09 17:48 ` pault at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-09 15:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pault at gcc dot gnu dot org 2006-12-09 15:17 -------
Subject: Bug 29821
Author: pault
Date: Sat Dec 9 15:17:16 2006
New Revision: 119690
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119690
Log:
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
Backports from trunk
PR fortran/29821
* resolve.c (resolve_operator): Only return result of
gfc_simplify_expr if expression is constant.
PR fortran/29912
* trans-expr.c (gfc_trans_arrayfunc_assign): Return NULL if the
lhs and rhs character lengths are not constant and equal for
character array valued functions.
PR fortran/29916
* resolve.c (resolve_symbol): Allow host-associated variables
in the specification expression of an array-valued function.
* expr.c (check_restricted): Accept host-associated dummy
array indices.
PR fortran/30003
* trans-array.c (gfc_trans_create_temp_array): Set the section
ends to zero.
(gfc_conv_array_transpose): Likewise.
(gfc_conv_section_startstride): Declare an expression for end,
set it from a the array reference and evaluate it for the info
structure. Zero the ends in the ss structure and set end, used
in the bounds check, from the info structure.
trans.h: Add and end array to the gfc_ss_info structure.
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
* gfortran.dg/parameter_array_section_1.f90: New test.
PR fortran/29912
* gfortran.dg/char_result_12.f90: New test.
PR fortran/29916
* gfortran.dg/host_dummy_index_1.f90: Added additional test.
PR fortran/30003
* gfortran.dg/allocatable_function_1.f90: Increase the number
of expected calls of free to 10; the lhs section reference is
now evaluated so there is another call to bar. Change the
comment appropriately.
* gfortran.dg/array_section_1.f90: New test.
Added:
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/array_section_1.f90
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/char_result_12.f90
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/parameter_array_section_1.f90
Modified:
branches/gcc-4_2-branch/gcc/fortran/ChangeLog
branches/gcc-4_2-branch/gcc/fortran/expr.c
branches/gcc-4_2-branch/gcc/fortran/resolve.c
branches/gcc-4_2-branch/gcc/fortran/trans-array.c
branches/gcc-4_2-branch/gcc/fortran/trans-expr.c
branches/gcc-4_2-branch/gcc/fortran/trans.h
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/allocatable_function_1.f90
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/host_dummy_index_1.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] [4.1 only] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (7 preceding siblings ...)
2006-12-09 15:18 ` [Bug fortran/29821] [4.2 and 4.1] " pault at gcc dot gnu dot org
@ 2006-12-09 15:20 ` pault at gcc dot gnu dot org
2006-12-09 17:48 ` pault at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-09 15:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pault at gcc dot gnu dot org 2006-12-09 15:20 -------
Fixed in trunk and 4.2. If I have time, I will patch 4.1 someday.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Summary|[4.2 and 4.1] ICE in |[4.1 only] ICE in
|gfc_typenode_for_spec, at |gfc_typenode_for_spec, at
|fortran/trans- |fortran/trans-
|types.c:666ans-types.c:666 |types.c:666ans-types.c:666
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/29821] [4.1 only] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
` (8 preceding siblings ...)
2006-12-09 15:20 ` [Bug fortran/29821] [4.1 only] " pault at gcc dot gnu dot org
@ 2006-12-09 17:48 ` pault at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-09 17:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pault at gcc dot gnu dot org 2006-12-09 17:48 -------
Subject: Bug 29821
Author: pault
Date: Sat Dec 9 17:47:45 2006
New Revision: 119694
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119694
Log:
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
Backports from trunk
PR fortran/29821
* resolve.c (resolve_operator): Only return result of
gfc_simplify_expr if expression is constant.
PR fortran/29912
* trans-expr.c (gfc_trans_arrayfunc_assign): Return NULL if the
lhs and rhs character lengths are not constant and equal for
character array valued functions.
PR fortran/29916
* resolve.c (resolve_symbol): Allow host-associated variables
in the specification expression of an array-valued function.
* expr.c (check_restricted): Accept host-associated dummy
array indices.
PR fortran/30003
* trans-array.c (gfc_trans_create_temp_array): Set the section
ends to zero.
(gfc_conv_section_startstride): Declare an expression for end,
set it from a the array reference and evaluate it for the info
structure. Zero the ends in the ss structure and set end, used
in the bounds check, from the info structure.
trans.h: Add and end array to the gfc_ss_info structure.
PR fortran/29820
* trans-array.c (gfc_get_derived_type): Once done, spread the
backend_decl to all identical derived types in all sibling
namespaces.
2006-12-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29821
* gfortran.dg/parameter_array_section_1.f90: New test.
PR fortran/29912
* gfortran.dg/char_result_12.f90: New test.
PR fortran/29916
* gfortran.dg/host_dummy_index_1.f90: Added additional test.
PR fortran/30003
* gfortran.dg/allocatable_function_1.f90: Increase the number
of expected calls of free to 10; the lhs section reference is
now evaluated so there is another call to bar. Change the
comment appropriately.
* gfortran.dg/array_section_1.f90: New test.
PR fortran/29820
* gfortran.dg/used_types_13.f90: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/array_section_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_12.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/parameter_array_section_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_types_13.f90
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/expr.c
branches/gcc-4_1-branch/gcc/fortran/resolve.c
branches/gcc-4_1-branch/gcc/fortran/trans-array.c
branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
branches/gcc-4_1-branch/gcc/fortran/trans-types.c
branches/gcc-4_1-branch/gcc/fortran/trans.h
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/host_dummy_index_1.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29821
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-12-09 17:48 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-13 21:30 [Bug fortran/29821] New: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666 anlauf at gmx dot de
2006-11-13 21:31 ` [Bug fortran/29821] " anlauf at gmx dot de
2006-11-13 21:40 ` burnus at gcc dot gnu dot org
2006-11-14 6:31 ` [Bug fortran/29821] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:666ans-types.c:666 fxcoudert at gcc dot gnu dot org
2006-11-14 21:24 ` pault at gcc dot gnu dot org
2006-11-14 21:48 ` pault at gcc dot gnu dot org
2006-11-17 16:22 ` pault at gcc dot gnu dot org
2006-12-04 19:30 ` pault at gcc dot gnu dot org
2006-12-09 15:18 ` [Bug fortran/29821] [4.2 and 4.1] " pault at gcc dot gnu dot org
2006-12-09 15:20 ` [Bug fortran/29821] [4.1 only] " pault at gcc dot gnu dot org
2006-12-09 17:48 ` pault 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).