This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21407] [4.1 Regression] wrong code with upcast in C++
- From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2005 15:09:03 -0000
- Subject: [Bug tree-optimization/21407] [4.1 Regression] wrong code with upcast in C++
- References: <20050506002331.21407.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-05-10 15:09 -------
And this would still work with the code i've written, because it's at offset 0
(which is why it's valid in C).
It would have worked before the fix, too.
It's only when you cast back *down* to the derived class (you'll note andrew's
example isn't really an upcast, because he's dynamic casting back down to a
derived class) that we were running into trouble.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21407