This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PPC ICE
On Tue, Aug 18, 2009 at 06:01:20PM -0700, Steve Kargl wrote:
> On Tue, Aug 18, 2009 at 05:45:01PM -0700, Steve Kargl wrote:
> > troutmask:sgk[206] gfc4x -c -std=f95 r.f90
> > r.f90:4.38:
> >
> > procedure (), pointer, nopass :: f
> > 1
> > Error: Fortran 2003: Procedure pointer at (1)
> > f951: internal compiler error: Segmentation fault: 11
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > See <http://gcc.gnu.org/bugs.html> for instructions.
> >
>
> (gdb) bt
> #0 0x000000000046cf14 in resolve_fl_derived (sym=0x2015ed380) at ../../gcc4x/gcc/fortran/resolve.c:9497
> #1 0x000000000046b8ab in resolve_symbol (sym=0x2015ed380) at ../../gcc4x/gcc/fortran/resolve.c:9992
> #2 0x000000000047f38e in traverse_ns (st=0x2015022e0, func=0x46b300 <resolve_symbol>) at ../../gcc4x/gcc/fortran/symbol.c:3225
> #3 0x000000000046eb00 in resolve_types (ns=0x2015aec00) at ../../gcc4x/gcc/fortran/resolve.c:11362
> #4 0x00000000004685af in gfc_resolve (ns=0x20160ad00) at ../../gcc4x/gcc/fortran/resolve.c:11454
> #5 0x000000000045d948 in gfc_parse_file () at ../../gcc4x/gcc/fortran/parse.c:3996
> #6 0x000000000048d7ce in gfc_be_parse_file (set_yydebug=<value optimized out>) at ../../gcc4x/gcc/fortran/f95-lang.c:241
> #7 0x000000000074e3fe in toplev_main (argc=3, argv=0x7fffffffe2a8) at ../../gcc4x/gcc/toplev.c:1026
> #8 0x0000000000405cec in _start ()
>
The ICE goes away with the following patch.
2009-08-18 Steven G. Kargl <kargl@gcc.gnu.org>
* resolve.c (resolve_fl_derived): Don't dereference a NULL pointer.
Index: resolve.c
===================================================================
--- resolve.c (revision 150866)
+++ resolve.c (working copy)
@@ -9494,7 +9494,8 @@ resolve_fl_derived (gfc_symbol *sym)
}
/* Procedure pointer components: Check PASS arg. */
- if (c->attr.proc_pointer && !c->tb->nopass && c->tb->pass_arg_num == 0)
+ if (c->attr.proc_pointer
+ && (c->tb && !c->tb->nopass && c->tb->pass_arg_num == 0))
{
gfc_symbol* me_arg;
If this is considered to be correct, I'll dejagnu-ify the
testcase.
--
Steve