Red Hat Bugzilla – Bug 252
Run time error
Last modified: 2008-05-01 11:37:48 EDT
I use gcc and g++ to compile the following small code
If I use -O2 option, and when I run the program
I get "segmentation fault(core dumped)". If I do
not use "-O2" option, I won't get any error. I also
upgrade gcc-188.8.131.52 to gcc-2.8.1 and I still get
same type error, but only when I change "double a" into
Why does this happen?
BTW, I upgraded the libc and glib package ftped from
your web site.
I tested this in a Pc with redhat 5.0, and no error.
In /usr/include/__math.h:552, if I change this line into
long long int __p = (long int) __y,
then I won't get error. Is this the problem?
The original line is
long long int __p = (long long int) __y
Could not replicate this problem on a test machine.
Used gcc-184.108.40.206-14 rpm.
Did you try to change "double a;" to "int a;"? Only one
of them will generate error by using gcc-220.127.116.11 with "-O2" option.