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/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
Date: Thu, 23 Nov 2023 12:00:30 +0000	[thread overview]
Message-ID: <bug-112336-4-9Y5POqxail@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112336-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 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:f9982ef4f55bd3a63745e03ac6d68b4a92fa8bce

commit r14-5776-gf9982ef4f55bd3a63745e03ac6d68b4a92fa8bce
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Nov 23 12:59:54 2023 +0100

    expr: Fix &bitint_var handling in initializers [PR112336]

    As the following testcase shows, we ICE when trying to emit ADDR_EXPR of
    a bitint variable which doesn't have mode width.
    The problem is in the EXTEND_BITINT stuff which makes sure we treat the
    padding bits on memory reads from user bitint vars as undefined.
    When expanding ADDR_EXPR on such vars inside outside of initializers,
    expand_expr_addr* uses EXPAND_CONST_ADDRESS modifier and EXTEND_BITINT
    does nothing, but in initializers it keeps using EXPAND_INITIALIZER
    modifier.  So, we need to treat EXPAND_INITIALIZER the same as
    EXPAND_CONST_ADDRESS for this regard.

    2023-11-23  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/112336
            * expr.cc (EXTEND_BITINT): Don't call reduce_to_bit_field_precision
            if modifier is EXPAND_INITIALIZER.

            * gcc.dg/bitint-41.c: New test.

  parent reply	other threads:[~2023-11-23 12:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
2023-11-01 15:31 ` [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) pinskia at gcc dot gnu.org
2023-11-01 15:32 ` pinskia at gcc dot gnu.org
2023-11-22 16:40 ` jakub at gcc dot gnu.org
2023-11-22 18:18 ` [Bug middle-end/112336] " jakub at gcc dot gnu.org
2023-11-23 12:00 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-23 12:01 ` jakub at gcc dot gnu.org
2023-11-24  7:16 ` pinskia at gcc dot gnu.org
2023-11-24  7:17 ` pinskia 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-112336-4-9Y5POqxail@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).