Path: utzoo!telly!ddsw1!lll-winken!killer!texbell!bigtex!milano!cs.utexas.edu!tut.cis.ohio-state.edu!moose.cita.utoronto.ca!trq From: trq@moose.cita.utoronto.ca (Tom Quinn) Newsgroups: gnu.gcc.bug Subject: bug in gcc 1.30 for Sun FPA Message-ID: <8810181407.AA06061@moose.cita.utoronto.ca> Date: 18 Oct 88 14:07:24 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 70 The following code will cause gcc to get a fatal error if compiled with "-O -mfpa" options. This gcc version 1.30 on a Sun3/160 running SunOS 4.0. Tom Quinn Canadian Institute for Theoretical Astrophysics trq@moose.cita.utoronto.ca UUCP - decvax!utgpu!moose!trq BITNET - quinn@utorphys.bitnet ARPA - trq%moose.cita.toronto.edu@relay.cs.net The compile: gcc -g -v -O -mfpa -sun3 -c nsat2.c gcc version 1.30 /usr/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__OPTIMIZE__ -D__HAVE_FPA__ -D__HAVE_68881__ -Dmc68020 nsat2.c /tmp/cca06058.cpp GNU CPP version 1.30 /usr/local/lib/gcc-cc1 /tmp/cca06058.cpp -quiet -dumpbase nsat2.c -mfpa -g -O -version -o /tmp/cca06058.s GNU C version 1.30 (68k, MIT syntax) compiled by GNU C version 1.30. gcc: Program cc1 got fatal signal 6. The code: ------------------------------------------------------------------------ extern double drem(); struct sat { double a; double e; double pomega; double mu; double omega; double phi; double p0; double yr, yi; int n; int index; int current; }; static double dt; struct sat *nextpl(pl, nplanet, test) struct sat *pl; int nplanet; struct sat test; { struct sat *sptr, *encptr; double dtmin, dttry; double dphi; dtmin = 1.0 / 1.0e-12 ; encptr = 0 ; for(sptr = pl; sptr < pl + nplanet; sptr++) { if(sptr->current == 0) { if(test.a > sptr->a) { dphi = test.phi - sptr->phi; } else { dphi = sptr->phi - test.phi; } dphi = drem(dphi, (2.0*3.14159265358979323846 ) ); if(dphi < 0.0) dphi = (2.0*3.14159265358979323846 ) + dphi; if((dttry = dphi/({ double __value, __arg = (sptr->omega - test.omega); asm ("fpabsd %1, %0": "=xy" (__value): "xym" (__arg)); __value; }) ) < dtmin) { dtmin = dttry; encptr = sptr; } } } for(sptr = pl; sptr < pl + nplanet; sptr++) { dphi = (2.0*3.14159265358979323846 ) ; if((dttry = dphi/({ double __value, __arg = (sptr->omega - test.omega); asm ("fpabsd %1, %0": "=xy" (__value): "xym" (__arg)); __value; }) ) < dtmin) { dtmin = dttry; encptr = sptr; } } dt = dtmin; return (encptr); }