This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Segmentation fault bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]