This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/70526] [5/6 Regression] GCC 6 miscompiles Firefox JIT compiler


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]