This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15837] Optimization (of templatized functions?)
- 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 Jun 2004 04:49:28 -0000
- Subject: [Bug c++/15837] Optimization (of templatized functions?)
- References: <20040605201151.15837.adruab@voria.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-06 04:49 -------
No what I am saying is that your code does things which are "undefined" by the C++ standard so the
compiler is able to do anything (including erasing your hard drive, no gcc will not produce code to do
that though). Casting to a different type and then accessing the data inside is declared as undefined
(there are a few exceptions to that rule, like you access the data via a char pointer and there is no
aliasing problems, you can cast to a type which adds const or violate and there is no aliasing problems
but casting between different pointer types and then accessing the data for both of the type is
undefined).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15837