This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61421] Invalid -O2 optimization breaks program
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jun 2014 20:38:58 +0000
- Subject: [Bug c++/61421] Invalid -O2 optimization breaks program
- Auto-submitted: auto-generated
- References: <bug-61421-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61421
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2014-06-05
Ever confirmed|0 |1
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to mimamer from comment #9)
> Now that I have read enough about aliasing rules I realize that they are
> considerably fucked up and that their is no way to efficiently downcast
> without violating strict aliasing rules.
I don't see any downcasting, all I see is side casting; at least with your code
sections so far.
How are list2<T>::node and T declared? Does the first element of node a T or
inherits from T? If not there is no downcasting, it is rather side casting and
that is what makes the code undefined.