This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/39895] gcc-4.4 -Wstrict-aliasing and -Wstrict-aliasing=3 behaves like -Wstrict-aliasing=2 in gcc-4.3
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Apr 2009 14:29:22 -0000
- Subject: [Bug middle-end/39895] gcc-4.4 -Wstrict-aliasing and -Wstrict-aliasing=3 behaves like -Wstrict-aliasing=2 in gcc-4.3
- References: <bug-39895-15165@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from rguenther at suse dot de 2009-04-25 14:29 -------
Subject: Re: gcc-4.4 -Wstrict-aliasing and
-Wstrict-aliasing=3 behaves like -Wstrict-aliasing=2 in gcc-4.3
On Sat, 25 Apr 2009, pinskia at gmail dot com wrote:
> ------- Comment #10 from pinskia at gmail dot com 2009-04-25 14:25 -------
> Subject: Re: gcc-4.4 -Wstrict-aliasing and
> -Wstrict-aliasing=3 behaves like -Wstrict-aliasing=2 in gcc-4.3
>
> On Sat, Apr 25, 2009 at 7:22 AM, edwintorok at gmail dot com
> <gcc-bugzilla@gcc.gnu.org> wrote:
>
> > Hmm, looks like the only way out is for me to put #if defined(__GNUC__) &&
> > (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) and use memcpy.
> > Either that or add a configure rule to add -fno-strict-aliasing.
>
> GCC has been able to optimize memcpy since at least 3.0.0 so using:
> #if (__GNUC__ >=3)
>
> Should be good enough (undefined macros are substituted with 0 in #if's).
Not on the tree level though. At least 4.3 doesn't optimize it there
which may indeed pessimize optimization.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39895