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 tree-optimization/111015] [11/12/13/14 Regression] __int128 bitfields optimized incorrectly to  the 64 bit operations
Date: Wed, 30 Aug 2023 09:57:53 +0000	[thread overview]
Message-ID: <bug-111015-4-D5Kisv4e0H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111015-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:beabb96786e4b3e1a820e400c09b1c1c9ab06287

commit r11-10968-gbeabb96786e4b3e1a820e400c09b1c1c9ab06287
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Aug 30 10:47:21 2023 +0200

    store-merging: Fix up >= 64 bit insertion [PR111015]

    The following testcase shows that we mishandle bit insertion for
    info->bitsize >= 64.  The problem is in using unsigned HOST_WIDE_INT
    shift + subtraction + build_int_cst to compute mask, the shift invokes
    UB at compile time for info->bitsize 64 and larger and e.g. on the testcase
    with info->bitsize happens to compute mask of 0x3f rather than
    0x3f'ffffffff'ffffffff.

    The patch fixes that by using wide_int wi::mask + wide_int_to_tree, so it
    handles masks in any precision (up to WIDE_INT_MAX_PRECISION ;) ).

    2023-08-30  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/111015
            * gimple-ssa-store-merging.c
            (imm_store_chain_info::output_merged_store): Use wi::mask and
            wide_int_to_tree instead of unsigned HOST_WIDE_INT shift and
            build_int_cst to build BIT_AND_EXPR mask.

            * gcc.dg/pr111015.c: New test.

    (cherry picked from commit 49a3b35c4068091900b657cd36e5cffd41ef0c47)

  parent reply	other threads:[~2023-08-30  9:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 13:53 [Bug rtl-optimization/111015] New: " pshevchuk at pshevchuk dot com
2023-08-14 14:01 ` [Bug rtl-optimization/111015] " rguenth at gcc dot gnu.org
2023-08-14 14:04 ` [Bug tree-optimization/111015] [11/12/13/14 Regression] " rguenth at gcc dot gnu.org
2023-08-15 23:06 ` mikpelinux at gmail dot com
2023-08-16 15:14 ` mikpelinux at gmail dot com
2023-08-29 12:41 ` jakub at gcc dot gnu.org
2023-08-29 14:24 ` jakub at gcc dot gnu.org
2023-08-30  8:47 ` cvs-commit at gcc dot gnu.org
2023-08-30  9:33 ` cvs-commit at gcc dot gnu.org
2023-08-30  9:49 ` cvs-commit at gcc dot gnu.org
2023-08-30  9:57 ` cvs-commit at gcc dot gnu.org [this message]
2023-08-30 10:00 ` 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-111015-4-D5Kisv4e0H@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).