This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/70526] [5/6 Regression] GCC 6 miscompiles Firefox JIT compiler
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 May 2016 13:42:46 +0000
- Subject: [Bug middle-end/70526] [5/6 Regression] GCC 6 miscompiles Firefox JIT compiler
- Auto-submitted: auto-generated
- References: <bug-70526-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70526
--- Comment #23 from Richard Biener <rguenth at gcc dot gnu.org> ---
A fix for your testcase would also be to do
template<typename T>
struct AlignedStorage2
{
union U
{
char mBytes[sizeof(T)];
uint64_t mDummy;
} u;
typedef T _T __attribute__((may_alias));
const _T* addr() const { return reinterpret_cast<const _T*>(u.mBytes); }
_T* addr() { return static_cast<_T*>(static_cast<void*>(u.mBytes)); }
};
that is, making sure to return may_alias pointers (and use
AlignedStorage2<>::_T
for temporaries you save addr to and do other accesses). The stores done
via that type are allowed to be accessed with an effective type of
TypedOrValueRegister.