Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 57480 - floating point exception - g++ 2.96-98
floating point exception - g++ 2.96-98
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2001-12-13 13:46 EST by Dan Maas
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-01 21:05:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dan Maas 2001-12-13 13:46:40 EST
Description of Problem:
This short C++ fragment causes gcc 2.96-98 to print "Internal error: 
Floating point exception" when compiled with -O2 (no FPE with -O0).

(yes, I know this code won't work correctly even if it did compile...)

I've seen other floating point exception bugs in Bugzilla, but they were 
all for earlier versions of gcc, and marked CLOSED.

Steps to Reproduce:
1. g++ bugcase.cpp -c -O2

// bugcase.cpp

template<class T>
class MyArray {
	T* p;
	int nused;
	void append(T foo)
		p[nused++] = foo;

typedef float v3_t[3];

void test(v3_t v)
	MyArray<v3_t> a;
Comment 1 Richard Henderson 2004-10-01 21:05:04 EDT
As of gcc 3.2, we issue the diagnostic

z.c: In member function `void MyArray<T>::append(T) [with T=float[3]]':
z.c:20:   instantiated from here
z.c:11: ISO C++ forbids assignment of arrays

which is probably what we were trying to do beforehand, and got confused.

Note You need to log in before you can comment on or make changes to this bug.