🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #466

GNU C bug report

#466
From: Phil Hochstetler
Date: Thu, 13 Jul 1989 20:16
37 lines
1413 bytes
Version of GNU CC:	gcc version 1.35
Input file:

#ifdef	COMMENT
When GNU C compiles the following program on the Symmetry, the resulting
executable core dumps in the printf:

According to the originator of this bug (which has since been fixed on 
PCC and ATS CC) the incorrect code is generated since "the trunc instruction
connot convert a number greater than the signed maximum." (At least that's
what it happened on those two compilers.
#endif

/* 04521.c - make sure that this program doesn't bomb on the printf
 * dmose  7/13/89
 */

#include <stdio.h>

main()
{
	double d;
	unsigned bogus = 1;

	d = ((double) bogus);
	printf("%e\n", d);	/*works*/
	fflush();
	printf("%e\n", ((double) bogus));	/*core dumps in printf*/
}

Compiled via:		gcc -o foo foo.c
tm.h and md file:	md -> config/i386.md
			tm.h -> config/tm-seq386.h
type of machine:	Sequent SYMMETRY
OS name and version:	DYNIX(R) V3.0.15
Bad behavior:		Running compiled program gets a
			floating point exception in printf.
Technical Details
Message-ID: <8907132032.AA26854@decwrl.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!DECWRL.DEC.COM!sequent!phil

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!DECWRL.DEC.COM!sequent!phil
From: sequent!phil@DECWRL.DEC.COM (Phil Hochstetler)
Newsgroups: gnu.gcc.bug
Subject: GNU C bug report
Message-ID: <8907132032.AA26854@decwrl.dec.com>
Date: 13 Jul 89 20:16:08 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 37