* 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
* Re: cc -O bug?
1994-06-23 17:56 cc -O bug? Stan Joseph Simon
@ 1994-06-24 11:10 ` system PRIVILEGED account
0 siblings, 0 replies; 2+ messages in thread
From: system PRIVILEGED account @ 1994-06-24 11:10 UTC (permalink / raw)
Stan Joseph Simon (ssb6+@andrew.cmu.edu) wrote:
: 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.
: [...]
: 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
I tried this example with OSF V2.0, and both results
were identical, with optimization and without one.
(with c and cxx compilers).
Michael
^ 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