public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113255] [11/12/13/14 Regression] wrong code with -O2 -mtune=k8
Date: Fri, 12 Jan 2024 08:48:05 +0000	[thread overview]
Message-ID: <bug-113255-4-JfnlrTV5PK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113255-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/alias.cc b/gcc/alias.cc
index b2ec4806d22..0150dd699db 100644
--- a/gcc/alias.cc
+++ b/gcc/alias.cc
@@ -2272,6 +2272,8 @@ static bool
 base_alias_check (rtx x, rtx x_base, rtx y, rtx y_base,
                  machine_mode x_mode, machine_mode y_mode)
 {
+  return 1;
+
   /* If the address itself has no known base see if a known equivalent
      value has one.  If either address still has no known base, nothing
      is known about aliasing.  */

(an experiment I did many years ago already) gives clean testresults
besides

+FAIL: gcc.dg/guality/pr41447-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
+FAIL: gcc.dg/guality/pr41447-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution
test
+FAIL: gcc.dg/guality/pr41447-1.c   -Os  -DPREVENT_OPTIMIZATION  execution test
+FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test

and only minor change in code generation:

   text    data     bss     dec     hex filename
48374841          64824 1939512 50379177        300b9a9 ../obj2/gcc/cc1plus
48375065          64824 1939512 50379401        300ba89 gcc/cc1plus

where the larger binary is the patched one.

Assembly-wise there are scheduling changes, missed scheduling over spills.

Recovering this and similar cases should be as easy as marking spill
MEMs with a flag (in MEM_EXPR) for example, distinguishing (classes of)
stack memory from the rest.  We should have this already (spill_slot_decl,
set_mem_attrs_for_spill), not sure why it doesn't look effective.

Improving test coverage for desired transforms would be nice as well.

  parent reply	other threads:[~2024-01-12  8:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 23:24 [Bug c/113255] New: " mednafen at sent dot com
2024-01-06 23:53 ` [Bug target/113255] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-01-07 12:13 ` jakub at gcc dot gnu.org
2024-01-07 19:48 ` ubizjak at gmail dot com
2024-01-09  7:52 ` rguenth at gcc dot gnu.org
2024-01-09  7:58 ` jakub at gcc dot gnu.org
2024-01-09  8:00 ` ubizjak at gmail dot com
2024-01-09  9:27 ` jakub at gcc dot gnu.org
2024-01-09 10:20 ` rguenth at gcc dot gnu.org
2024-01-09 12:09 ` rguenth at gcc dot gnu.org
2024-01-10  8:57 ` rguenth at gcc dot gnu.org
2024-01-12  8:48 ` rguenth at gcc dot gnu.org [this message]
2024-01-23  7:08 ` cvs-commit at gcc dot gnu.org
2024-01-23  7:10 ` [Bug target/113255] [11/12/13 " rguenth at gcc dot gnu.org
2024-01-23 14:38 ` cvs-commit at gcc dot gnu.org
2024-02-01 12:53 ` rguenth at gcc dot gnu.org
2024-02-01 13:08 ` rguenth at gcc dot gnu.org
2024-02-05  7:35 ` cvs-commit 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-113255-4-JfnlrTV5PK@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).