https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71723
Bug ID: 71723
Summary: ICE with attempted pointer initialization
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: w6ws at earthlink dot net
Target Milestone: ---
The following test case demonstrates an ICE when compiling a program attempting
to use the F2008 pointer initialization feature. The example is not legal.
Nonetheless, the compiler should not ICE.
module data_mod
implicit none
type data_t
integer :: i
end type
type(data_t), pointer :: data
! Causes a gfortran ICE
integer, pointer :: idata => data%i
end module
The ICE occurs with both gfortran 4.8 and a snapshot of the 7.0 trunk from
April 29, 2016. Here is the trunk snapshot details:
f951: internal compiler error: output_operand: invalid expression as operand
0x8b4de3 output_operand_lossage(char const*, ...)
../../gcc-trunk/gcc/final.c:3409
0x8b573d output_addr_const(_IO_FILE*, rtx_def*)
../../gcc-trunk/gcc/final.c:3998
0xe9a10e assemble_integer_with_op(char const*, rtx_def*)
../../gcc-trunk/gcc/varasm.c:2668
0xe9a18d default_assemble_integer(rtx_def*, unsigned int, int)
../../gcc-trunk/gcc/varasm.c:2684
0xe9a1fd assemble_integer(rtx_def*, unsigned int, unsigned int, int)
../../gcc-trunk/gcc/varasm.c:2700
0xea0db4 output_constant
../../gcc-trunk/gcc/varasm.c:4749
0xea17af assemble_variable_contents
../../gcc-trunk/gcc/varasm.c:2062
0xeab69d assemble_variable(tree_node*, int, int, int)
../../gcc-trunk/gcc/varasm.c:2238
0xeb0f39 varpool_node::assemble_decl()
../../gcc-trunk/gcc/varpool.c:589
0x7cebed output_in_order
../../gcc-trunk/gcc/cgraphunit.c:2231
0x7ceee3 symbol_table::compile()
../../gcc-trunk/gcc/cgraphunit.c:2468
0x7d1779 symbol_table::finalize_compilation_unit()
../../gcc-trunk/gcc/cgraphunit.c:2564
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ /usr/local/gcc-trunk/bin/gfortran --version
GNU Fortran (GCC) 7.0.0 20160429 (experimental)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$