This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21407] New: [4.1 Regression] wrong code with upcast in C++
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2005 00:23:34 -0000
- Subject: [Bug tree-optimization/21407] New: [4.1 Regression] wrong code with upcast in C++
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The is huge bug which effects a large amount of C++, we should not abort.
extern "C" void abort(void);
struct T1 {int a, b; virtual void f(){}};
struct T : T1 { struct T1 w; int b; };
void foo (struct T1 *p) { struct T *q = dynamic_cast<T*>(p); if (q->b != 2) abort (); }
int main () { struct T c; c.b = 2; foo (&c); return 0; }
--
Summary: [4.1 Regression] wrong code with upcast in C++
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: critical
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: dberlin at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21407