🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #388

Re: gcc compiler bug ?

#388
From: Peter W. Flur
Date: Tue, 14 Apr 1992 14:10
40 lines
1487 bytes
|->  From osborn@eecom.gatech.edu Tue Apr 14 09:00:15 1992
|->  Return-Path: <osborn@eecom.gatech.edu>
|->  Date: Tue, 14 Apr 1992 09:00:13 -0500
|->  To: help@eecom
|->  From: osborn@eecom.gatech.edu
|->  Subject: gcc compiler bug ?
|->  
|->  
|->  There appears to be a bug in the gcc compiler on the hp's.  (I have not
|->  tried the suns yet.)
|->  
|->  The following program shows that the absolute value function (fabs) does
|->  not except double precision variables, as the man pages indicate.
|->  
|->  #include <math.h>
|->  
|->  main(ac,av)
|->  int ac;
|->  char *av[];
|->  {
|->  
|->  double a,b;
|->  
|->  a = 1.7;
|->  b = 0.5;
|->  printf("x = %g\n",fabs(a-b));
|->  printf("x = %g\n",fabs((a-b)));
|->  printf("x = %g\n",fabs((double)(a-b)));
|->  printf("x = %g\n",fabs((float)(a-b)));
|->  printf("x = %g\n",fabs(a*b));
|->  }
|->  
|->  Who should this bug be reported to ??  
|->  
|->  Allan Osborn
|->  
|->  

Well, in playing around, I see that this is a bug with the optimization or
lack thereof.  If you use gcc -O, it compiles fine.
Technical Details
Message-ID: <9204141410.AA02203@eecom.gatech.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!eecom.gatech.edu!flur

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!eecom.gatech.edu!flur
From: flur@eecom.gatech.edu (Peter W. Flur)
Subject: Re: gcc compiler bug ?
Message-ID: <9204141410.AA02203@eecom.gatech.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 14 Apr 1992 14:10:04 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 41