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/111445] [12/13/14 Regression] Wrong code at -Os on x86_64-linux-gnu since r12-1077-g57bf3751511
Date: Fri, 20 Oct 2023 12:36:21 +0000	[thread overview]
Message-ID: <bug-111445-4-ebJkQ1JnEL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111445-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
-Os -fallow-store-data-races -fdisable-tree-sccp -fno-tree-loop-im

makes the case simpler to look at, IVOPTs only mangles the last loop there:

Analyzing # of iterations of loop 2
  exit condition [d_26 + 1, + , 1](no_overflow) <= 1
  bounds on difference of bases: -255 ... 0
  result:
    zero if d_26 > 1
    # of iterations 1 - (unsigned int) d_26, bounded by 1
  number of iterations 1 - (unsigned int) d_26; zero if d_26 > 1
..
Selected IV set for loop 2 at t.c:22, 2 avg niters, 1 IVs:
Candidate 10:
  Var befor: ivtmp.26_28
  Var after: ivtmp.26_29
  Incr POS: at end
  IV struct:
    Type:       unsigned int
    Base:       (unsigned int) (d_26 + 1)
    Step:       1
    Biv:        N
    Overflowness wrto loop niter:       No-overflow

changing

+  _31 = d_26 + 1;
+  ivtmp.26_30 = (unsigned int) _31;
   goto <bb 6>; [100.00%]

   <bb 5> [local count: 118111600]:
   b.6_7 = b;
   _8 = (int) b.6_7;
   check (_8);
-  e_21 = e_15 + 1;
+  ivtmp.26_29 = ivtmp.26_28 + 1;

   <bb 6> [local count: 236223200]:
-  # e_15 = PHI <0(10), e_21(5)>
+  # ivtmp.26_28 = PHI <ivtmp.26_30(10), ivtmp.26_29(5)>
   _9 = (unsigned char) d_26;
   _10 = _9 + 1;
   _11 = (int) _10;
-  _12 = (int) e_15;
-  _13 = _11 + _12;
-  if (_13 <= 1)
+  _32 = (int) ivtmp.26_28;
+  if (_32 <= 1)
     goto <bb 5>; [50.00%]
   else
     goto <bb 7>; [50.00%]

  parent reply	other threads:[~2023-10-20 12:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 13:21 [Bug tree-optimization/111445] New: " shaohua.li at inf dot ethz.ch
2023-09-17 16:12 ` [Bug tree-optimization/111445] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-09-18  9:14 ` rguenth at gcc dot gnu.org
2023-10-20 12:04 ` rguenth at gcc dot gnu.org
2023-10-20 12:36 ` rguenth at gcc dot gnu.org [this message]
2023-10-20 13:08 ` rguenth at gcc dot gnu.org
2023-10-20 13:53 ` cvs-commit at gcc dot gnu.org
2023-10-20 13:54 ` [Bug tree-optimization/111445] [12/13 " rguenth at gcc dot gnu.org
2023-11-10 14:24 ` cvs-commit at gcc dot gnu.org
2023-11-14 14:20 ` [Bug tree-optimization/111445] [12 " rguenth at gcc dot gnu.org
2023-11-27 13:09 ` cvs-commit at gcc dot gnu.org
2023-11-27 13:10 ` rguenth at gcc dot gnu.org
2024-06-21  9:22 ` 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-111445-4-ebJkQ1JnEL@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).