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/110515] [12 Regression] llvm-15.0.7 possibly invalid code on -O3
Date: Mon, 27 Nov 2023 11:34:57 +0000	[thread overview]
Message-ID: <bug-110515-4-f2u53ln1Pn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110515-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

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

commit r12-10007-gfe39ced331e76a85bb57b71b8acd9de9122bd91c
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 5 15:57:49 2023 +0200

    tree-optimization/110515 - wrong code with LIM + PRE

    In this PR we face the issue that LIM speculates a load when
    hoisting it out of the loop (since it knows it cannot trap).
    Unfortunately this exposes undefined behavior when the load
    accesses memory with the wrong dynamic type.  This later
    makes PRE use that representation instead of the original
    which accesses the same memory location but using a different
    dynamic type leading to a wrong disambiguation of that
    original access against another and thus a wrong-code transform.

    Fortunately there already is code in PRE dealing with a similar
    situation for code hoisting but that left a small gap which
    when fixed also fixes the wrong-code transform in this bug even
    if it doesn't address the underlying issue of LIM speculating
    that load.

    The upside is this fix is trivially safe to backport and chances
    of code generation regressions are very low.

            PR tree-optimization/110515
            * tree-ssa-pre.cc (compute_avail): Make code dealing
            with hoisting loads with different alias-sets more
            robust.

            * g++.dg/opt/pr110515.C: New testcase.

    (cherry picked from commit 9f4f833455bb35c11d03e93f802604ac7cd8b740)

  parent reply	other threads:[~2023-11-27 11:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01 21:52 [Bug middle-end/110515] New: [14 " slyfox at gcc dot gnu.org
2023-07-01 21:56 ` [Bug middle-end/110515] " slyfox at gcc dot gnu.org
2023-07-01 22:11 ` pinskia at gcc dot gnu.org
2023-07-01 22:12 ` [Bug middle-end/110515] " pinskia at gcc dot gnu.org
2023-07-01 22:12 ` [Bug middle-end/110515] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-01 22:37 ` pinskia at gcc dot gnu.org
2023-07-01 23:32 ` pinskia at gcc dot gnu.org
2023-07-03  7:12 ` rguenth at gcc dot gnu.org
2023-07-04 22:40 ` slyfox at gcc dot gnu.org
2023-07-05 10:57 ` rguenth at gcc dot gnu.org
2023-07-05 12:36 ` rguenth at gcc dot gnu.org
2023-07-05 13:55 ` rguenth at gcc dot gnu.org
2023-07-06  7:30 ` cvs-commit at gcc dot gnu.org
2023-07-06  7:30 ` [Bug middle-end/110515] [12/13 " rguenth at gcc dot gnu.org
2023-07-06 10:09 ` slyfox at gcc dot gnu.org
2023-07-07 12:07 ` [Bug middle-end/110515] [12 " cvs-commit at gcc dot gnu.org
2023-11-27 11:34 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-27 11:38 ` rguenth 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-110515-4-f2u53ln1Pn@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).