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: 25 Sep 2004 05:41:18 -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-25 05:41 -------
I am perfectly willing to entertain the possibility that I am being dense or
misguided, but we're talking about 'void *' here. You can't get a 'void *' by
taking the address of a 'void' and you can't dereference a 'void *' to get
a 'void'. The only use of 'void *' is for type aliasing.
If you cannot alias at all without '-fno-strict-aliasing', that would imply
that you can do *nothing* with a 'void *' without defining it. That, obviously,
can't be right.
The documentation for '-fstrict-aliasing' talks about an object of one type
being at the same address as an object of another type. But 'void' is not a
type of object, so I don't see that I'm violating aliasing rules.
DS
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17665