public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikpelinux at gmail dot com" <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: Tue, 15 Aug 2023 23:06:32 +0000	[thread overview]
Message-ID: <bug-111015-4-dChjsvdcfd@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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #3 from Mikael Pettersson <mikpelinux at gmail dot com> ---
10.5.0 is good, 11.4.0 and above are affected, started with (or was exposed
by):

commit ed01d707f8594827de95304371d5b62752410842
Author: Eric Botcazou <ebotcazou@gcc.gnu.org>
Date:   Mon May 25 22:13:11 2020 +0200

    Fix internal error on store to FP component at -O2

    This is about a GIMPLE verification failure at -O2 or above because
    the GIMPLE store merging pass generates a NOP_EXPR between a FP type
    and an integral type.  This happens when the bit-field insertion path
    is taken for a FP field, which can happen in Ada for bit-packed record
    types.

    It is fixed by generating an intermediate VIEW_CONVERT_EXPR.  The patch
    also tames a little the bit-field insertion path because, for bit-packed
    record  types in Ada, you can end up with large bit-field regions, which
    results in a lot of mask-and-shifts instructions.

    gcc/ChangeLog
            * gimple-ssa-store-merging.c
(merged_store_group::can_be_merged_into):
            Only turn MEM_REFs into bit-field stores for small bit-field
regions
            (imm_store_chain_info::output_merged_store): Be prepared for
sources
            with non-integral type in the bit-field insertion case.
            (pass_store_merging::process_store): Use MAX_BITSIZE_MODE_ANY_INT
as
            the largest size for the bit-field case.

    gcc/testsuite/ChangeLog
            * gnat.dg/opt84.adb: New test.

 gcc/ChangeLog                   |  9 +++++
 gcc/gimple-ssa-store-merging.c  | 20 ++++++++---
 gcc/testsuite/ChangeLog         |  4 +++
 gcc/testsuite/gnat.dg/opt84.adb | 74 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/gnat.dg/opt84.adb

  parent reply	other threads:[~2023-08-15 23:06 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 [this message]
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
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-dChjsvdcfd@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).