[Bug c++/45462] Bad optimization in -O3 sometimes

2010-09-02 Thread yotambarnoy at gmail dot com
--- Comment #14 from yotambarnoy at gmail dot com 2010-09-02 20:47 --- Getting back to the original question, I did some reading online and I can't figure out why this breaks the strict aliasing rules. Isn't void * some kind of special case? Shouldn't I be able t

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-09-01 Thread yotambarnoy at gmail dot com
--- Comment #12 from yotambarnoy at gmail dot com 2010-09-01 18:35 --- Right. Unfortunately > typedef my_unaligned_aliasing_uint32 uint32 > __attribute__((aligned(1),may_alias)); > > inline __attribute__((__always_inline__)) uint32 READ_UINT32(const void *ptr) > { >

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
--- 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 c

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
--- Comment #6 from yotambarnoy at gmail dot com 2010-09-01 04:32 --- I recently implemented a custom memcpy for ScummVM. I didn't notice the standard memcpy using lwl and lwr. In any case, how would memcpy do it any better? Unless you're referring to the new memcpy inlinin

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
--- Comment #4 from yotambarnoy at gmail dot com 2010-08-31 15:24 --- Good job picking up on that. There must be a better way of telling the compiler to generate lwr and lwl MIPS instructions without breaking strict aliasing rules...? Thanks a bunch! -- yotambarnoy at gmail dot

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
--- Comment #2 from yotambarnoy at gmail dot com 2010-08-31 11:53 --- Created an attachment (id=21603) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21603&action=view) header.h, used by logic.cpp -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45462

[Bug c++/45462] Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
--- Comment #1 from yotambarnoy at gmail dot com 2010-08-31 11:52 --- Created an attachment (id=21602) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21602&action=view) Logic.ii, where gcc makes the mistake LogicUp() is the critical function -- http://gcc.gnu.org/b

[Bug c++/45462] New: Bad optimization in -O3 sometimes

2010-08-31 Thread yotambarnoy at gmail dot com
Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yotambarnoy at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45462