🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2687

gcc-1.35/sun4-os4 [const function attribute and -O don't mix]

#2687
From: Jim Meyering
Date: Tue, 23 May 1989 19:32
33 lines
1418 bytes
/*
 * gcc-1.35/sun4-os4 "-O/const" bug: cc1 exhausts virtual memory.
 *
 * Simplifying the code in foo(), removing the `const' attribute
 * from the declaration of epslon(), or compiling without -O
 * allow compilation to terminate normally.
 *
 * > % gcc -v -O   -c bug.c -o bug.o
 * > gcc version 1.35
 * >  /p/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__OPTIMIZE__ bug.c /tmp/cca16852.cpp
 * > GNU CPP version 1.35
 * >  /p/lib/gcc-cc1 /tmp/cca16852.cpp -quiet -dumpbase bug.c -O -version -o /tmp/cca16852.s
 * > GNU C version 1.35 (sparc) compiled by GNU C version 1.35.
 * > bug.c: In function foo:
 * > bug.c:31: Virtual memory exhausted.
 * > 59.9u 30.9s 2:10 69% 0+20936k 8+14io 47pf+0w
 * > %
 */
const double epslon(double x) { return(1.0); }

void
foo()
{
	double x;

	while (1) {
		if ( x > epslon(1.0) || x < epslon(1.0)) {
			x = 1.0;
		}
	}
}
---
Jim Meyering      meyering@cs.utexas.edu
Technical Details
Message-ID: <8905231932.AA17559@ai.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!meyering

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!meyering
From: meyering@CS.UTEXAS.EDU (Jim Meyering)
Newsgroups: gnu.gcc.bug
Subject: gcc-1.35/sun4-os4 [const function attribute and -O don't mix]
Message-ID: <8905231932.AA17559@ai.cs.utexas.edu>
Date: 23 May 89 19:32:41 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: UofTX @ Austin CS Department
Lines: 33