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/103202] [12 regression] gcc miscompiles ed-1.17
Date: Fri, 12 Nov 2021 09:33:46 +0000	[thread overview]
Message-ID: <bug-103202-4-nheAVhnZT3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103202-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Sergei Trofimovich from comment #3)
> Created attachment 51776 [details]
> main_loop_simpler.c
> 
> Attaching seemingly simpler example. I applied most inlines and simplified
> loops as much as I could. It looks like VRP does something funny with:
> 
>   while (n > 0)
>   {
>     while (n-- > 0)
>     {
> 
> Looking at 039t.mergephi1
> 
> with -fno-tree-vrp:
> 
> --- no-vrp/ed-main_loop.c.039t.mergephi1    2021-11-12 09:07:55.120821967
> +0000
> +++ yes-vrp/ed-main_loop.c.039t.mergephi1    2021-11-12 09:07:55.186822973
> +0000
> @@ -93,7 +93,7 @@
>    # np_6 = PHI <np_7(10), np_40(6)>
>    # n_8 = PHI <n_9(10), n_23(6)>
>    n_23 = n_8 + -1;
> -  if (n_8 > 0)
> +  if (n_8 != 0)
>      goto <bb 4>; [INV]
>    else
>      goto <bb 8>; [INV]
> 
> I think our loop is executed with n == -1 on real data and vrp provided
> incorrect range.

But how would the inner loop be reachable with n == -1?

  parent reply	other threads:[~2021-11-12  9:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 23:59 [Bug tree-optimization/103202] New: " slyfox at gcc dot gnu.org
2021-11-12  0:01 ` [Bug tree-optimization/103202] " pinskia at gcc dot gnu.org
2021-11-12  0:05 ` pinskia at gcc dot gnu.org
2021-11-12  1:38 ` pinskia at gcc dot gnu.org
2021-11-12  7:43 ` rguenth at gcc dot gnu.org
2021-11-12  9:15 ` slyfox at gcc dot gnu.org
2021-11-12  9:33 ` rguenth at gcc dot gnu.org [this message]
2021-11-12  9:35 ` [Bug tree-optimization/103202] [12 regression] gcc miscompiles ed-1.17 since r12-3876-g4a960d548b7d7d94 marxin at gcc dot gnu.org
2021-11-12 10:18 ` aldyh at gcc dot gnu.org
2021-11-12 10:19 ` aldyh at gcc dot gnu.org
2021-11-12 15:23 ` aldyh at gcc dot gnu.org
2021-11-12 15:24 ` aldyh at gcc dot gnu.org
2021-11-12 16:42 ` slyfox at gcc dot gnu.org
2021-11-12 19:46 ` cvs-commit at gcc dot gnu.org
2021-11-12 19:47 ` aldyh 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-103202-4-nheAVhnZT3@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).