Segmentation fault bug
Kevin VanHorn
kvanhorn@fonix.com
Tue Oct 27 04:02:00 GMT 1998
Compiler version:
egcs-2.90.27 980315 (egcs-1.0.2 release)
Source file:
attached as file comptest.cpp
file obtained by running through preprocessor (g++ -E comptest.cpp)
attached as file comptest.cpp.out
Command args used to compile program:
g++ -O2 -frepo -c comptest.cpp
g++ -O2 -frepo -o comptest comptest.o
Machine and OS:
Intel Pentium Pro
RedHat Linux 5.1
Contents of /proc/version:
Linux version 2.0.34 (root@porky.redhat.com) (gcc version 2.7.2.3)
#1 Fri May 8 16:05:57 EDT 1998
Operands given to configure command:
Unknown. Compiler installed from RedHat .rpm file.
Mods made to compiler source:
None.
Problem description:
Program crashes with Segmentation Fault after printing out
"(1): A2 = 24.1762". Apparently the crash occurs during the call to
pow() in line 35. This problem does not occur if the program
is compiled without optimization. Strangely enough, it also does
not occur if lines 30--32 of the program are deleted --
if (r1 > r2) swap(r1, r2);
if (r2 > r3) swap(r2, r3);
if (r1 > r2) swap(r1, r2);
-- even though these lines are never executed.
comptest.cpp.gz
comptest.cpp.out.gz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: comptest.cpp.gz
Type: application/x-gzip
Size: 536 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981027/96d05a42/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: comptest.cpp.out.gz
Type: application/x-gzip
Size: 8276 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981027/96d05a42/attachment-0001.bin>
More information about the Gcc-bugs
mailing list