public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/98366] [11 Regression] wrong-code with memcmp and -m32
Date: Fri, 18 Dec 2020 09:26:58 +0000	[thread overview]
Message-ID: <bug-98366-4-Vsg8t31FUh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98366-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2020-12-18  9:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  2:52 [Bug middle-end/98366] New: " mpolacek at gcc dot gnu.org
2020-12-18  2:53 ` [Bug middle-end/98366] " mpolacek at gcc dot gnu.org
2020-12-18  2:56 ` mpolacek at gcc dot gnu.org
2020-12-18  8:59 ` pinskia at gcc dot gnu.org
2020-12-18  9:06 ` marxin at gcc dot gnu.org
2020-12-18  9:18 ` jakub at gcc dot gnu.org
2020-12-18  9:26 ` jakub at gcc dot gnu.org [this message]
2020-12-18  9:35 ` jakub at gcc dot gnu.org
2020-12-18 15:43 ` jakub at gcc dot gnu.org
2020-12-19 21:24 ` cvs-commit at gcc dot gnu.org
2020-12-19 21:32 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98366-4-Vsg8t31FUh@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).