[Bug tree-optimization/88739] [7/8/9 Regression] Big-endian union bug

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 8 12:09:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88739

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
So somehow build up exhaustive testing via

struct S # n # AT # m { \
    T pad : m; \
    T val : n; \
};
T __attribute__((noinline)) load8at0 () { return u.s8at0.val; }
...
union U {
    T val;
    struct S8at0 s8at0;
...
} u;
int main()
{
  volatile T val = 0x0102030405060708;
  u.val = val;
  if (u.s8at0.val != load8at0 ())
    __builtin_abort ();
...
  return 0;
}

with T possibly unsigned __int128_t, for n in {8, 16, 32, 64}
and m in [0, 128 - n].


More information about the Gcc-bugs mailing list