[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
g++ bug report for SUN architecture
From: |
Bastien Chevreux |
Subject: |
g++ bug report for SUN architecture |
Date: |
29 Sep 2000 22:15:07 GMT |
User-agent: |
slrn/0.9.6.2 (SunOS) |
/*
g++ bug report (Bastien Chevreux -- address@hidden)
Type: probably optimizer bug
Systems where bug appeared appeared first: SUN Solaris 2.7
GCC version: gcc 2.95.2
>>> Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs : gcc version 2.95.2
19991024 (release)
Bug was reproducible on: SUN Solaris 2.51
GCC version: egcs 1.1.1
>>> Reading specs from
/home/chevreux/pub/SunOS/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.60/specs
: gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
Bug did not appear on crosschecked machine: Linux 2.2 for x86
GCC version: 2.95.2
>>> Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs : gcc
version 2.95.2 19991024 (release)
How to reproduce the bug (on the concerned systems):
Save this file as: cerror.C
Compile this code with: g++ -O cerror.C
Start with: ./a.out
The (wrong) output is:
############ 0
############ 2
############ 4
The correct behaviour can be seen by compiling without -O: g++ cerror.C
Start with: ./a.out
The (correct) output is:
############ 0
############ 1
############ 2
############ 3
############ 4
When uncommenting the cout in line 67, the bug disappears even when compiled
with -O
*/
#include <iostream.h>
class terror{
};
void testthrow()
{
terror t;
throw(t);
}
int main(void)
{
for(int i=0; i < 5; i++ ) {
cout << "############ " << i << endl;
try{
testthrow();
}
catch(terror t){
}
// when the folowing cout is uncommented, the bug does not appear
// even when compiled with -O
// cout << "y";
}
return 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- g++ bug report for SUN architecture,
Bastien Chevreux <=
- Prev by Date:
Fwd:
- Previous by thread:
Fwd:
- Index(es):