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: unassig...@gcc.gnu.org
        ReportedBy: bur...@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

Reply via email to