🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2551

bug in sparc gcc 1.34

#2551
From: Tom Quinn
Date: Thu, 20 Apr 1989 15:28
45 lines
1810 bytes
The following code will cause gcc to get a fatal signal when compiled
with the "-O" flag.  This is gcc version 1.34 on a Sun4/110 running
SunOs 4.0.

Tom Quinn                 Canadian Institute for Theoretical Astrophysics
trq@moose.cita.utoronto.ca
UUCP   - decvax!utgpu!moose.cita!trq
BITNET - quinn@utorphys.bitnet
ARPA   - trq%moose.cita.toronto.edu@relay.cs.net

The compile:
gcc -g -v -O   -c lgamma.c -o lgamma.o
gcc version 1.34
 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__OPTIMIZE__ lgamma.c /tmp/cca01314.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-cc1 /tmp/cca01314.cpp -quiet -dumpbase lgamma.c -g -O -version -o /tmp/cca01314.s
GNU C version 1.34 (sparc) compiled by GNU C version 1.34.
gcc: Program cc1 got fatal signal 11.

The code:
------------------------------------------------------------------------
extern const double sin (double x);
extern const double log (double x);
extern const double floor (double x);
int	signgam = 0;
static double pi	= 3.1415926535897932384626434;
static double
neg(arg)
double arg;
{
	double t;
	double pos();
	arg = -arg;
	t = floor(arg);
	if (arg - t  > 0.5e0)
	    t += 1.e0;				 
	signgam = (int) (t - 2*floor(t/2));	 
	signgam = signgam - 1 + signgam;	 
	t = arg - t;				 
	if (t < 0.e0) {
	    t = -t;
	    signgam = -signgam;
	}
	return(-log(arg*pos(arg)*sin(pi*t)/pi));
}
Technical Details
Message-ID: <8904201528.AA05512@moose.cita.utoronto.ca>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!MOOSE.CITA.UTORONTO.CA!trq

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!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 sparc gcc 1.34
Message-ID: <8904201528.AA05512@moose.cita.utoronto.ca>
Date: 20 Apr 89 15:28:14 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 45