This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34813] ICE on incorrect nested type constructor (fold-const.c (fold_convert):2629)
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2008 10:20:49 -0000
- Subject: [Bug fortran/34813] ICE on incorrect nested type constructor (fold-const.c (fold_convert):2629)
- References: <bug-34813-13648@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from dfranke at gcc dot gnu dot org 2008-03-21 10:20 -------
Last night, I tracked this to resolve.c (resolve_structure_cons), but I was not
100% sure what to do.
With the simplified testcase, Intel complains:
$> ifort pr34813.f90
fortcom: Error: pr34813.f90, line 15: The type of the NULL(MOLD) element in a
structure-constructor differs from the type of the component in the
derived-type-def.
tree = kd_tree(kd_tree_node(null()))
-----------------------------^
fortcom: Error: pr34813.f90, line 15: This array or function or substring is
invalid in constant expressions.
tree = kd_tree(kd_tree_node(null()))
----------------^
fortcom: Error: pr34813.f90, line 15: Replacing invalid structure constructor
by integer 1 [<NULL_STRING>]
tree = kd_tree(kd_tree_node(null()))
^
Interestingly, if it is slightly changed,
- tree = kd_tree(kd_tree_node(null()))
+ integer, pointer :: i
+ tree = kd_tree(kd_tree_node(null(i)))
Intel gives an ICE while gfortran happily (but wrongly?) accepts it:
$> ifort -warn all pr34813.f90
fortcom: Severe: pr34813.f90, line 12: **Internal compiler error: internal
abort** Please report this error along with the circumstances in which it
occurred in a Software Problem Report. Note: File and line given may not be
explicit cause of this error.
tree = kd_tree(kd_tree_node(null(i)))
------------------------------^
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34813