public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "absoler at smail dot nju.edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113838] regression of redundant load operation introduced by -fno-tree-forwprop introduce
Date: Fri, 09 Feb 2024 03:39:17 +0000	[thread overview]
Message-ID: <bug-113838-4-wwpnj0hf5m@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113838-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from absoler at smail dot nju.edu.cn ---
(In reply to Andrew Pinski from comment #2)
> The difference from the gimple level IR:
> ```
>   _14 = g_26[5][3][0];
>   _15 = (int) _14;
>   _16 = _13 ^ _15;
>   g_51 = _16;
>   if (_13 != _15)
> ```
> 
> vs:
> ```
>   _14 = g_26[5][3][0];
>   _15 = (int) _14;
>   _16 = _13 ^ _15;
>   g_51 = _16;
>   if (_16 != 0)
>     goto <bb 4>; [50.00%]
>   else
>     goto <bb 3>; [50.00%]
> ```
> 
> 
> This is expected behavior even for the x86_64 target

The gimple ir has no problem, but `_13` is replaced with g_26[5][3][0] in the
follow-up process, this shouldn't be expected behavior.

We question this option because we found in an older version of gcc (10.2.0),
only the O2 option is needed to produce the same bad code, so we worry about
there's a hidden un-fixed problem and it's re-triggered by this option.

Besides, the bad binary code introduce more load operation than the source code
(without optimization), so we thought it's necessary to check it regardless of
which optimization is disabled.

  parent reply	other threads:[~2024-02-09  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 17:37 [Bug tree-optimization/113838] New: " absoler at smail dot nju.edu.cn
2024-02-08 17:50 ` [Bug tree-optimization/113838] " jakub at gcc dot gnu.org
2024-02-09  1:11 ` [Bug target/113838] " pinskia at gcc dot gnu.org
2024-02-09  3:37 ` absoler at smail dot nju.edu.cn
2024-02-09  3:38 ` absoler at smail dot nju.edu.cn
2024-02-09  3:39 ` absoler at smail dot nju.edu.cn [this message]
2024-02-09  7:59 ` xry111 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-113838-4-wwpnj0hf5m@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).