This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23793] Unhealthy optimization. Accessing double with reinterpret_cast.
- From: "martsummsw at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2005 04:59:00 -0000
- Subject: [Bug c++/23793] Unhealthy optimization. Accessing double with reinterpret_cast.
- References: <20050909075051.23793.martsummsw@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From martsummsw at hotmail dot com 2005-09-10 04:58 -------
First of all - Thank you.
And I promise never to report an error against such an old version.
Second I however think I am happy to haven reported it since nobody on
comp.lang.c++ knew ..... I found nothing on the internet or
man math.h | grep -i sign // this might have changed since my old version
Third I know that the reinterpret_cast is more than bad behavior and it
strictly needs not to work. However I am not casting an int into a char-array
where I should be able to hit eg an odd adresses (or?) and I guess that no
padding could be in my way(?)
So I could see no *reason* for it not to work. I know the union would do it
(more) secure. I was just so stupid to think that it would not be as efficient.
Summa: I am happy that I have been told about signbit -
and I am really sorry to have wasted your time...
Regards
Thorbjørn
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23793