🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #5971

Re: compiled code dumps core

#5971
From: Scott J. Kramer
Date: Fri, 17 Jan 1997 00:00
56 lines
1921 bytes
Dean S. Messing (deanm@sharplabs.com) wrote:
: Friends, 

: I believe I have discovered a bug in the the gcc compiler.

		[ ... orig deleted ... ]

: Here is a tiny piece of code to tickle the bug:

:        int INF[]	= {0x7ff00000, 0x0};		/* IEEE infinity.  */
:        
:        main()
:        {
:          double f;
:          f = *(double *)INF;
:          printf("f = %lf\n", f);
:          return 0;
:        }      

: I named the above file `oops.c'
: Here is a `typescript' to demonstrate the bug.

:      Script started on Wed Jan 15 18:41:02 1997
:      1:cortex=>gcc oops.c
:      2:cortex=>a.out
:      Bus Error(coredump)
:      3:cortex=>^D

		[ ... orig deleted ... ]

I get the same result with gcc-2.7.2 built on Solaris 2.5, running on
a SS20 with Solaris 2.5.1.

But when compiled+run on an Ultra-1 with the same OS/gcc environment
*plus* binutils-2.7:

    % ./oops
    f = Inf

So, I temporarily renamed GNU `ld' and `as', then recompiled the test
program.  Result?  "Bus error (core dumped)"

As much as possible (my machine/OS combinations are limited), I
narrowed it down to `ld' -- GNU's works, Sun's doesn't.

Compiled with the "standard" MIPS compiler on an SGI Indigo2 running
IRIX 6.2:

    % ./oops
    f = inf

Hmm.  I hope someone else understands all this... my compiler
knowledge is minimal at best.

-sjk
Technical Details
Message-ID: <kramerE44uBo.254@netcom.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <199701160258.SAA03305@cortex>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,1b0cb93b1c507fb3
X-Google-Attributes: gid113d02,public
From: kramer@netcom.com (Scott J. Kramer)
Subject: Re: compiled code dumps core
Date: 1997/01/17
Message-ID: <kramerE44uBo.254@netcom.com>
X-Deja-AN: 210331235
sender: bug-gcc-request@prep.ai.mit.edu
references: <199701160258.SAA03305@cortex>
organization: Netcom On-Line Services
x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Thu, 16 Jan 1997 22:18:14 EST
newsgroups: gnu.gcc.bug