This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45462] Bad optimization in -O3 sometimes
- From: "pinskia at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2010 06:17:26 -0000
- Subject: [Bug c++/45462] Bad optimization in -O3 sometimes
- References: <bug-45462-19630@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from pinskia at gmail dot com 2010-09-01 06:17 -------
Subject: Re: Bad optimization in -O3 sometimes
I am not talking about a library solution at all. I am talking about a
solution inside the compiler. Gcc will optimize memcpy; how much for
MIPS is a good question. Try it out and see. Oh if you are using
scei's gcc you really should be reporting issues to them.
On Aug 31, 2010, at 10:03 PM, "yotambarnoy at gmail dot com"
<gcc-bugzilla@gcc.gnu.org
> wrote:
>
>
> ------- Comment #8 from yotambarnoy at gmail dot com 2010-09-01
> 05:03 -------
> Unfortunately, a lib based solutions are difficult for me to
> implement. The
> reason is that the current PSP SDK uses newlib. I can probably
> change my
> personal toolchain with some work, but then it's a custom
> modification that
> needs to be replicated to every other ScummVM dev as well as our
> buildbot. Not
> impossible, but not work I'd like to get in to right now.
>
> In any case, it sounds like what you're saying is that memcpy has asm
> instructions in the right place to use lwl and lwr. I can also do
> that in my
> implementation.
>
> My request was more general, as in gcc needs some kind of custom
> keyword to
> tell it to allow unaligned pointers and to generate appropriate
> unaligned code,
> so we don't have to trick the compiler into doing it in a way that
> ruins
> optimization. Something like __unaligned__ uint32 *ptr32 = bytePtr;
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45462
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45462