We have the following failures on SPARC: FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O0 FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O1 FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O2 FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O3 -fomit-frame-pointer FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O3 -fomit-frame-pointer -funroll-loops FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -O3 -g FAIL: gfortran.fortran-torture/execute/userop.f90 compilation, -Os The problem is at resolve.c:1418: sprintf (msg, "Operands of user operator '%s' at %%L are %s/%s", e->uop->ns->proc_name->name, gfc_typename (&op1->ts), gfc_typename (&op2->ts)); e->uop->ns->proc_name is NULL. So an out-of-bounds address is passed to sprintf and we get a SIGSEGV inside the libc. Note that we don't get it with a cross-compiler on Linux/x86, but the address is NULL there anyway.
Created attachment 7220 [details] Putative patch Try this please. The original code looks like it is a relic from some past time where operators kept their names in their own namespaces. I don't know if that time ever existed. 2004-09-26 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/17676 * resolve.c (resolve_operator): Use correct operator name in message.
> Try this please. The original code looks like it is a relic from some past time > where operators kept their names in their own namespaces. I don't know if that > time ever existed. > > 2004-09-26 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> > > PR fortran/17676 > * resolve.c (resolve_operator): Use correct operator name in message. The patch fixes all the userop.f90 failures. Thanks for the prompt response!
Subject: Bug 17676 CVSROOT: /cvs/gcc Module name: gcc Changes by: tobi@gcc.gnu.org 2004-10-08 00:16:28 Modified files: gcc/fortran : ChangeLog resolve.c Log message: PR fortran/17676 * resolve.c (resolve_operator): Use correct operator name in message. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.232&r2=1.233 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.19&r2=1.20
Sorry, I forgot to actually submit this patch :( Applied as obvious after re-testing. Fixed.