This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52426] New: ICE for c_loc with array constructor
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Feb 2012 22:54:50 +0000
- Subject: [Bug fortran/52426] New: ICE for c_loc with array constructor
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52426
Bug #: 52426
Summary: ICE for c_loc with array constructor
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Reported at comp.lang.fortran at
The following program ICEs with a segfault.
==22541== Invalid read of size 8
==22541== at 0x57480B: gfc_resolve_expr(gfc_expr*) (resolve.c:2742)
==22541== by 0x57CC8C: resolve_code(gfc_code*, gfc_namespace*)
(resolve.c:9334)
That's in gfc_iso_c_func_interface the line:
args_sym = args->expr->symtree->n.sym;
I haven't checked Fortran 2008 plus TS 29113 whether it is allowed or not, but
I think it isn't. (Note: F2008 and TS extend what is allowed for c_loc.)
use iso_c_binding
print *, c_loc([1])
end