This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34295] Bad optimization in an inlined method
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 17:23:37 -0000
- Subject: [Bug c++/34295] Bad optimization in an inlined method
- References: <bug-34295-15458@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from steven at gcc dot gnu dot org 2007-11-29 17:23 -------
Try compiling with -fno-strict-aliasing. This is only automatically enabled at
-O2 or higher. See the fine manual.
I'm not sure what you mean with "more efficient than memcpy". If you mean more
efficient as in producing better code: Have you actually checked what comes out
of the compiler if you do this? If you mean more elegant from a coding style
point of view: The language provides the means, it is called "union".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34295