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 tree-optimization/111798] [14 Regression] Recent change causing testsuite regression and poor code on mcore-elf
Date: Mon, 16 Oct 2023 08:29:29 +0000	[thread overview]
Message-ID: <bug-111798-4-rqzjJ9sX57@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111798-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-10-16
                 CC|richard.guenther at gmail dot com  |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
If I configured correctly the only change (early) SRA does is

 unsigned int fn1K (unsigned int x)
 {
+  <unnamed-unsigned:6> y$k;
...
@@ -57,13 +53,14 @@

   <bb 2> :
   y = sK;
-  _1 = y.k;
+  y$k_13 = sK.k;
+  _1 = y$k_13;
   _2 = (unsigned char) _1;
   _3 = (unsigned char) x_9(D);
   _4 = _2 + _3;
   _5 = (<unnamed-unsigned:6>) _4;
-  y.k = _5;
-  _6 = y.k;
+  y$k_14 = _5;
+  _6 = y$k_14;
   _11 = (unsigned int) _6;
   y ={v} {CLOBBER(eol)};
   return _11;

and later DSE eliminates 'y' completely.  Note I can't see any big assembly
difference -O2 vs -O2 -fno-tree-sra so I wonder if I really reproduced the
significantly worse code generation issue.  In fact generated code looks
better, the stack slot is elided:

> diff -u t.s.good t.s.bad 
--- t.s.good    2023-10-16 10:18:27.457651977 +0200
+++ t.s.bad     2023-10-16 10:07:49.997656268 +0200
@@ -19,13 +19,11 @@
        .export fn1K
        .type   fn1K, @function
 fn1K:
-       subi    sp,8
        lrw     r7, sK
        ld.b    r7,(r7)
        addu    r2,r7
        movi    r7,63
        and     r2,r7
-       addi    sp,8
        jmp     r15
        .size   fn1K, .-fn1K
        .align  1

  parent reply	other threads:[~2023-10-16  8:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 15:30 [Bug tree-optimization/111798] New: " law at gcc dot gnu.org
2023-10-16  6:36 ` [Bug tree-optimization/111798] " rguenth at gcc dot gnu.org
2023-10-16  8:29 ` rguenth at gcc dot gnu.org [this message]
2024-03-07 21:04 ` law at gcc dot gnu.org
2024-03-09  6:03 ` law at gcc dot gnu.org
2024-03-11  9:49 ` rguenth at gcc dot gnu.org
2024-05-07  7:42 ` [Bug tree-optimization/111798] [14/15 " 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-111798-4-rqzjJ9sX57@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).