bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in g++


From: Gary Felder
Subject: Bug in g++
Date: Mon, 23 Apr 2001 19:45:12 -0700

I have RedHat Linux 7.0 running on a Pentium machine. (I believe it's a
Pentium III. I can ask the system administrator if this is important.) I
have all of the gcc patches that have been issued by RedHat for this version
of the operating system. When I run

g++ -v

I get

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)

I have a program that works fine under every other compiler I have tested,
including earlier versions of g++ and Visual C++. In Red Hat 7.0 it
invariably produces incorrect output. I have reduced the problem to the
enclosed file. It initializes an array, modifies that array by adding to it
several functions that should return 0, and then prints one of the array
members. In its current version it produces the result "nan". Trivial
modifications (e.g. printing other array members first) change the results
to various numbers.

I am compiling with the command:

g++ -O1 latticeeasy.cpp

If I don't use optimization it works fine.

Thank you for your help.

Gary Felder
address@hidden

Attachment: latticeeasy.cpp
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]