Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* cc -O bug?
@ 1994-06-23 17:56 Stan Joseph Simon
  1994-06-24 11:10 ` system PRIVILEGED account
  0 siblings, 1 reply; 2+ messages in thread
From: Stan Joseph Simon @ 1994-06-23 17:56 UTC (permalink / raw)



I have a problem with cc on the DEC alpha.  When I compile the following
piece of code with "cc test.c" the program runs correctly.

--test.c--------------------------------------

#include <stdio.h>

int main(){
  double T, F7=78125.0, T30= 1073741824.0;

  T= F7 / T30;
  printf("T=%lf, F7=%lf, T30=%lf, f7/t30=%.15lf\n", T, F7, T30, F7 / T30);

  return 0;
}

--end test.c--------------------------------------


However, when I use optimization "cc -O test.c" I get incorrect
output--the division comes out to 0.  This happens with optimization
levels -O2 and -O3, but not -O1. (A similar problem occurs with DEC's
cxx compiler.) 

Is there a solution to this?  Or should I just not use optimization?
I am using osf 1.3.

Stan





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-06-24 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-06-23 17:56 cc -O bug? Stan Joseph Simon
1994-06-24 11:10 ` system PRIVILEGED account

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