This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17665] wrong code with -O2
- From: "davids at webmaster dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Sep 2004 00:28:50 -0000
- Subject: [Bug c/17665] wrong code with -O2
- References: <20040924231306.17665.davids@webmaster.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From davids at webmaster dot com 2004-09-26 00:28 -------
Ahh, I think I get it now. If I have:
void *foo;
Then 'foo' follows the aliasing rules for a 'void *'. But if I do:
(void **)foo
The fact that 'foo' is a 'void *' has no affect on aliasing because *I* casted
it to a 'void **'. So it follows the aliasing rules for 'void **' because
that's what I specifically asked it to do.
Thanks for your patience.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17665