Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: murphy@dco.dec.com (Rick Murphy)
Subject: Re: OSF/1 1.3 cc -O Bug!
Date: 22 Feb 1994 19:19:33 GMT	[thread overview]
Message-ID: <2kdls5$ief@decuac.dec.com> (raw)
In-Reply-To: CLMwL8.9uw@wst.edvz.sbg.ac.at


In article <CLMwL8.9uw@wst.edvz.sbg.ac.at>, gwesp@wst.edvz.sbg.ac.at (Wesp 
Gerhard) writes:
>First of all, please note that that piece of code may even have
>an application: If int and double have the same storage size, 
>this should just 'typecast' the argument x to an int, yielding the internal 
>representation of the double. You could then use the int to extract
>the fields of the double (sign, mantissa, exponent).

It's not that easy (but that's the compiler's problem..) the floating argument
is passed in a floating point register and needs to be stored/loaded in order
to be converted to integer.

> I don't know if the bug (YES, this is a *BUG*) resides in the OS or the
>compiler, but I hope the people at DEC (who are reading this, right?) will
>*IMMEDIATELY* find that out and fix it. 

Anytime the compiler crashes it's a bug. Fortunately, this is fixed in 2.0:
% uname -a
OSF1 rhmosf.dco.dec.com X2.0 201.1 alpha
% cat crash.c
int i(double x)
{
  int *p;
  p= &x;
  return *p;
}

% cc -O crash.c
/usr/lib/cmplrs/cc/cfe: Warning: crash.c, line 4: Incompatible pointer type assi
gnment
   p= &x;
 ---^
ld:
Unresolved:
main

-- 
Rick Murphy, WA1SPT/4			Washington Federal Programs Office
Domain:  murphy@dco.dec.com		 Technical Support Group
Bang:    decwrl!burfle.enet!murphy	This posting expresses MY opinions only;
Ding:    301-306-2040.			 I do not speak for Digital.


  reply	other threads:[~1994-02-22 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-02-21 22:02 OSF/1 1.3 cc -O Bug! Frederick (Rick) A Niles
1994-02-22 16:31 ` Wesp Gerhard
1994-02-22 19:19   ` Rick Murphy [this message]
1994-02-23 11:47     ` Wesp Gerhard
1994-02-25 20:55       ` Rick Murphy
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox