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/114074] [11/12/13/14 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r8-343
Date: Mon, 26 Feb 2024 09:38:04 +0000	[thread overview]
Message-ID: <bug-114074-4-tT13fY20k3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114074-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=114052
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
           Keywords|                            |wrong-code

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly related to the other bug showing issues with
infer_loop_bounds_from_signedness.  OTOH:

Analyzing # of iterations of loop 1
  exit condition -2 <= [-2, + , -2](no_overflow)
  bounds on difference of bases: 0 ... 0
  result:
    # of iterations 1, bounded by 1
Loop 1 iterates 1 times.
Loop 1 iterates at most 0 times.
Loop 1 likely iterates at most 0 times.
Analyzing # of iterations of loop 1
  exit condition -2 <= [-2, + , -2](no_overflow)
  bounds on difference of bases: 0 ... 0
  result:
    # of iterations 1, bounded by 1
Removed pointless exit: if (_4 >= -2)

we incorrectly (looking at the IL) determine the exit will be taken in the
first iteration somehow.  Not sure where that other upper bound comes from,
but we have it zero upon entry of the pass already.

CDDCE has

Induction variable (int) -1 + 2 * iteration does not wrap in statement _1 =
~a.4_18;
 in loop 1.
Statement _1 = ~a.4_18;
 is executed at most 1 (bounded by 1) + 1 times in loop 1.
Induction variable (int) -2147480647 + -6002(OVF) * iteration does not wrap in
statement _2 = _1 * 2147480647;
 in loop 1. 
Statement _2 = _1 * 2147480647;
 is executed at most 0(OVF) (bounded by 0) + 1 times in loop 1.

ranges look somewhat odd (_4 starts at -4 but the merge PHI a.4_18 only at -2),
but not necessarily wrong.  So this might also be a SCEV issue computing
that odd IV for _2.

  parent reply	other threads:[~2024-02-26  9:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 10:48 [Bug tree-optimization/114074] New: wrong code at -O1 and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2024-02-23 10:54 ` [Bug tree-optimization/114074] [11/12/13/14 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r8-343 jakub at gcc dot gnu.org
2024-02-23 11:02 ` jakub at gcc dot gnu.org
2024-02-23 11:34 ` rguenth at gcc dot gnu.org
2024-02-23 12:48 ` jakub at gcc dot gnu.org
2024-02-26  9:38 ` rguenth at gcc dot gnu.org [this message]
2024-02-26 11:48 ` rguenth at gcc dot gnu.org
2024-02-26 12:03 ` rguenth at gcc dot gnu.org
2024-02-27  9:55 ` cvs-commit at gcc dot gnu.org
2024-02-27  9:57 ` [Bug tree-optimization/114074] [11/12/13 " rguenth at gcc dot gnu.org
2024-03-08 11:04 ` rguenth at gcc dot gnu.org
2024-03-08 13:41 ` cvs-commit at gcc dot gnu.org
2024-03-19 12:12 ` cvs-commit at gcc dot gnu.org
2024-03-19 12:14 ` [Bug tree-optimization/114074] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-19 12:15 ` rguenth at gcc dot gnu.org
2024-03-19 12:15 ` rguenth at gcc dot gnu.org
2024-03-19 12:16 ` 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-114074-4-tT13fY20k3@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).