public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103226] [12 Regression] Recent change to copy-headers causes execution failure for gcc.dg/torture/pr80974
Date: Sun, 14 Nov 2021 10:59:01 +0000	[thread overview]
Message-ID: <bug-103226-4-MsY5II2kW8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103226-4@http.gcc.gnu.org/bugzilla/>

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
I can't opine on the intricacies of the loopch pass, but the decision the path
solver took was correct:

./cc1 a.c -fdump-tree-all-details -quiet -I/tmp -O2 --param threader-debug=all

Then in the *.ch2 dump file I see:

==============================================
path_range_query: compute_ranges for path: 5->12
range_defined_in_block (BB12) for h_8 is int [0, 0]

=========== BB 5 ============
b.0_3   int [0, 0][5, +INF]
    <bb 5> [local count: 60236916]:
    e = 1;
    goto <bb 12>; [100.00%]


=========== BB 12 ============
Imports: h_8  
Exports: h_8  
b.0_3   int [0, 0][5, +INF]
    <bb 12> [local count: 602369155]:
    # h_8 = PHI <0(5), h_11(11)>
    if (h_8 != 9)
      goto <bb 19>; [90.00%]
    else
      goto <bb 13>; [10.00%]

etc.

The conditional in BB12 resolves to true:

   loopch static returned: _Bool [1, 1]

Which I got from a small tweak to the ch source:

diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 566cc275317..d5d80e33450 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -74,7 +74,14 @@ entry_loop_condition_is_static (class loop *l,
path_range_query *query)
   int_range<2> r;
   query->compute_ranges (e);
   query->range_of_stmt (r, last);
-  return r == int_range<2> (desired_static_value, desired_static_value);
+  bool ret = (r == int_range<2> (desired_static_value, desired_static_value));
+  if (ret && dump_file)
+    {
+    fprintf (dump_file, "loopch static returned: ");
+    r.dump(dump_file);
+    fprintf (dump_file, "\n");
+    }
+  return ret;
 }

  reply	other threads:[~2021-11-14 10:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 20:39 [Bug tree-optimization/103226] New: " law at gcc dot gnu.org
2021-11-14 10:59 ` aldyh at gcc dot gnu.org [this message]
2021-11-15  9:03 ` [Bug tree-optimization/103226] " rguenth at gcc dot gnu.org
2021-11-16  2:30 ` law at gcc dot gnu.org
2021-11-17 11:14 ` aldyh at gcc dot gnu.org
2021-11-17 11:32 ` aldyh at gcc dot gnu.org
2021-11-17 15:00 ` tnfchris at gcc dot gnu.org
2021-11-17 15:02 ` tnfchris at gcc dot gnu.org
2021-11-17 15:53 ` aldyh at gcc dot gnu.org
2021-11-17 16:09 ` tnfchris at gcc dot gnu.org
2021-11-17 16:28 ` law at gcc dot gnu.org
2021-11-17 16:29 ` law at gcc dot gnu.org
2021-11-17 16:31 ` aldyh at gcc dot gnu.org
2021-11-17 17:18 ` aldyh at gcc dot gnu.org
2021-11-17 17:54 ` tnfchris at gcc dot gnu.org
2021-11-17 18:31 ` law at gcc dot gnu.org
2021-11-17 18:43 ` aldyh at gcc dot gnu.org
2021-11-17 19:26 ` aldyh at gcc dot gnu.org
2021-11-17 20:02 ` aldyh at gcc dot gnu.org
2021-11-18 13:28 ` aldyh at gcc dot gnu.org
2021-11-20  7:10 ` law at gcc dot gnu.org
2021-11-20  7:23 ` aldyh at gcc dot gnu.org
2021-11-20 16:30 ` cvs-commit at gcc dot gnu.org
2021-11-20 16:31 ` law at gcc dot gnu.org
2021-12-02 14:55 ` hp 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-103226-4-MsY5II2kW8@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).