[Bug middle-end/98366] [11 Regression] wrong-code with memcmp and -m32

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 18 09:26:58 GMT 2020


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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But
struct S {
  int b;
  int alignment;
  int c : 7;
  int d : 8;
  int e : 17;
} const e[] = {{0, 3, '(', 2, 0}};
typedef struct S S;

int memcmp (const void *, const void *, __SIZE_TYPE__);

int
main ()
{
  _Bool b = (!memcmp(e, (S[]){{.alignment = 3, '(', 2, 0}}, sizeof (S)));
  if (!b)
    __builtin_abort ();
}
should be valid because there is no padding but it aborts anyway, I think the
code mishandles bitfields.


More information about the Gcc-bugs mailing list