[Bug fortran/32884] ICE: Accessing non-local variable in PURE function

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Jul 24 18:29:00 GMT 2007



------- Comment #2 from burnus at gcc dot gnu dot org  2007-07-24 18:28 -------
Others cannot reproduce it (on i686 & x86_64), but here I can with gfortran-4.1
& 4.2 of SUSE, with the vanilla 4.2 and with 4.3.

The problem is for whatever reason the "&code->expr->where" argument to
gfc_error(). In error_print the "loc" argument is not NULL, but loc->lb->*
point to invalid locations, which gave an memory access error (segfault) in
show_locus when accessing lb->file.

484                   loc = va_arg (argp, locus *);
486                 if (have_l1)
(gdb) p loc
$8 = (locus *) 0xfdc13a
(gdb) p loc->lb
$9 = (gfc_linebuf *) 0x610072616200736e
(gdb) p loc->lb->file
Cannot access memory at address 0x6100726162007376
(gdb) p loc->lb->line
Cannot access memory at address 0x610072616200738a
(gdb) p loc->lb->file
Cannot access memory at address 0x6100726162007376

But no problem for others.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32884



More information about the Gcc-bugs mailing list