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/113421] wrong code with -O -fno-tree-fre and _BitInt() multiplication
Date: Wed, 17 Jan 2024 13:44:26 +0000	[thread overview]
Message-ID: <bug-113421-4-UW9rM3QiFt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113421-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from GCC 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:9f8ba332e988fb582f6ca32465f6d65283f53b3a

commit r14-8186-g9f8ba332e988fb582f6ca32465f6d65283f53b3a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 17 14:43:40 2024 +0100

    lower-bitint: Avoid overlap between destinations and sources in libgcc
calls [PR113421]

    The following testcase is miscompiled because the bitint lowering emits a
      .MULBITINT (&a, 1024, &a, 1024, &x, 1024);
    call.  The bug is in the overlap between the destination and source, that
is
    something the libgcc routines don't handle, they use the source arrays
    during the entire algorithms which computes the destination array(s).
    For the mapping of SSA_NAMEs to VAR_DECLs the code already supports that
    correctly, but the checking whether a load from memory can be used directly
    without a temporary even when earlier we decided to merge the
    multiplication/division/modulo etc. with a store didn't.

    The following patch implements that.

    2024-01-17  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113421
            * gimple-lower-bitint.cc (stmt_needs_operand_addr): Adjust function
            comment.
            (bitint_dom_walker::before_dom_children): Add g temporary to
simplify
            formatting.  Start at vop rather than cvop even if stmt is a store
            and needs_operand_addr.

            * gcc.dg/torture/bitint-50.c: New test.

  parent reply	other threads:[~2024-01-17 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 12:04 [Bug tree-optimization/113421] New: " zsojka at seznam dot cz
2024-01-16 17:07 ` [Bug tree-optimization/113421] " jakub at gcc dot gnu.org
2024-01-17 13:44 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-17 13:47 ` jakub at gcc dot gnu.org
2024-01-20 17:11 ` 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-113421-4-UW9rM3QiFt@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).