public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/37810] Bad store sinking job
Date: Mon, 26 Jul 2021 04:35:58 +0000	[thread overview]
Message-ID: <bug-37810-4-l3G1HSInTf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-37810-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2009-04-03 12:34:44         |2021-7-25

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For the reduced testcase in comment #2 I get now:
4.8.0+:
.L4:
        addl    $1, %eax
        movl    %eax, (%rbx)
        cmpl    4(%rbx), %eax
        je      .L8
.L3:
        testl   %eax, %eax
        jne     .L4

4.7.4 and before:
.L3:
        testl   %eax, %eax
        je      .L8
        addl    $1, %eax
        cmpl    4(%rbx), %eax
        movl    %eax, (%rbx)
        jne     .L3

Or on the trunk at the gimple level:
  <bb 3> [local count: 1014686025]:
  _1 = prephitmp_10 + 1;
  iter_6(D)->n = _1;
  _2 = iter_6(D)->m;
  if (_1 == _2)
    goto <bb 4>; [5.50%]
  else
    goto <bb 6>; [94.50%]

  <bb 4> [local count: 55807731]:
  g ();

  <bb 5> [local count: 114863530]:
  pretmp_11 = iter_6(D)->n;

  <bb 6> [local count: 1073741824]:
  # prephitmp_10 = PHI <pretmp_11(5), _1(3)>
  if (prephitmp_10 != 0)
    goto <bb 3>; [94.50%]
  else
    goto <bb 7>; [5.50%]

Aka the store still happens inside the loop unconditionally.

       reply	other threads:[~2021-07-26  4:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-37810-4@http.gcc.gnu.org/bugzilla/>
2021-07-26  4:35 ` pinskia at gcc dot gnu.org [this message]
2021-07-27  7:03 ` rguenth at gcc dot gnu.org
2008-10-12 15:14 [Bug tree-optimization/37810] New: " carlo at gcc dot gnu dot org
2008-10-12 15:21 ` [Bug tree-optimization/37810] " rguenth at gcc dot gnu dot org
2008-10-12 15:27 ` rguenth at gcc dot gnu dot org
2008-10-12 15:30 ` rguenth at gcc dot gnu dot org
2008-10-12 15:34 ` carlo at gcc dot gnu dot org
2009-04-03 12:34 ` rguenth at gcc dot gnu dot 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-37810-4-l3G1HSInTf@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).