public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit 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: Sat, 19 Dec 2020 21:24:58 +0000	[thread overview]
Message-ID: <bug-98366-4-qIch08Ek60@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 #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:69165332a914f1167c3077fa1f57afc64fd8a667

commit r11-6271-g69165332a914f1167c3077fa1f57afc64fd8a667
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Dec 19 22:24:10 2020 +0100

    expr: Fix up constant_byte_string bitfield handling [PR98366]

    constant_byte_string now uses a convert_to_bytes function, which doesn't
    handle bitfields at all (don't punt on them, just puts them into wrong bits
    or bytes).  Furthermore, I don't see a reason why that function should
exist
    at all, it duplicates native_encode_initializer functionality.
    Except that native_encode_initializer punted on flexible array members and
2
    tests in the testsuite relied on constant_byte_string handling those.
    So, this patch throws away convert_to_bytes, uses native_encode_initializer
    instead, but teaches it to handle flexible array members (only in the
    non-mask mode with off == -1 for now), furthermore, it adds various corner
    case checks that the old implementation was missing (like that STRING_CSTs
    use int as length and therefore we shouldn't try to build larger than that
    strings, or that native_encode*/native_interpret* APIs require sane
    host and target bytes (8-bit on both).

    2020-12-19  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/98366
            * fold-const.c (native_encode_initializer): Don't try to
            memset more than total_bytes with off == -1 even if len is large.
            Handle flexible array member initializers if off == -1 and mask is
            NULL.
            * expr.c (convert_to_bytes): Remove.
            (constant_byte_string): Use native_encode_initializer instead of
            convert_to_bytes.  Remove extraneous semicolon.  Punt on various
            corner-cases the APIs don't handle, like sizes > INT_MAX,
            BITS_PER_UNIT != 8, CHAR_BIT != 8.

            * gcc.c-torture/execute/pr98366.c: New test.

  parent reply	other threads:[~2020-12-19 21:24 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
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 [this message]
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-qIch08Ek60@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).