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/98117] [8/9/10/11 Regression] wrong code with "-O3 -fno-tree-scev-cprop" since r8-1163-g7078979b291419f3
Date: Mon, 07 Dec 2020 08:51:45 +0000	[thread overview]
Message-ID: <bug-98117-4-ZVkOMf0Ti0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98117-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
  <bb 2> [local count: 118111600]:
  c_lsm.6_7 = c;
  niters.8_1 = -c_lsm.6_7;
  if (c_lsm.6_7 > 240)
    goto <bb 11>; [10.00%]
  else
    goto <bb 6>; [90.00%]

  <bb 6> [local count: 106300440]:
  _18 = niters.8_1 + 240;
  _19 = _18 >> 4;
  # RANGE [1, 15] NONZERO 15
  bnd.9_17 = _19 + 1;

but here c == 0 and thus _19 + 1 is 16.  The number of latch invocations is 255
but the number of iterations is that + 1 and thus zero in the IVs type.  This
is why we have num_itersm1 and so I guess

      /* Peeling algorithm guarantees that vector loop bound is at least ONE,
         we set range information to make niters analyzer's life easier.  */
      if (stmts != NULL && log_vf)
        set_range_info (niters_vector, VR_RANGE,
                        wi::to_wide (build_int_cst (type, 1)),
                        wi::to_wide (fold_build2 (RSHIFT_EXPR, type,
                                                  TYPE_MAX_VALUE (type),
                                                  log_vf)));

needs to use TYPE_MAX_VALUE + 1 >> log_vf here to be on the safe side for the
"non-representable" niter value.

  parent reply	other threads:[~2020-12-07  8:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 11:31 [Bug tree-optimization/98117] New: wrong code with "-O3 -fno-tree-scev-cprop" suochenyao at 163 dot com
2020-12-03 11:51 ` [Bug tree-optimization/98117] [8/9/10/11 Regression] wrong code with "-O3 -fno-tree-scev-cprop" since r8-1163-g7078979b291419f3 marxin at gcc dot gnu.org
2020-12-03 12:30 ` rguenth at gcc dot gnu.org
2020-12-07  8:39 ` rguenth at gcc dot gnu.org
2020-12-07  8:51 ` rguenth at gcc dot gnu.org [this message]
2020-12-07  9:27 ` rguenth at gcc dot gnu.org
2020-12-07 11:06 ` cvs-commit at gcc dot gnu.org
2020-12-07 11:06 ` [Bug tree-optimization/98117] [8/9/10 " rguenth at gcc dot gnu.org
2021-01-11 14:10 ` cvs-commit at gcc dot gnu.org
2021-03-17  9:35 ` [Bug tree-optimization/98117] [8/9 " cvs-commit at gcc dot gnu.org
2021-04-26 10:46 ` [Bug tree-optimization/98117] [8 " cvs-commit at gcc dot gnu.org
2021-04-26 10:49 ` 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-98117-4-ZVkOMf0Ti0@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).