public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/113137] [14 regression] Failed bootstrap with -O3 -march=znver2
Date: Thu, 28 Dec 2023 18:08:10 +0000	[thread overview]
Message-ID: <bug-113137-4-YYoJneWG7x@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113137-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Ok, so this bug is simply fixed by:

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index f51ae3e719e..e7a5917bc4c 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -976,7 +976,8 @@ vec_init_loop_exit_info (class loop *loop)
       if (number_of_iterations_exit_assumptions (loop, exit, &niter_desc,
NULL)
          && !chrec_contains_undetermined (niter_desc.niter))
        {
-         if (!niter_desc.may_be_zero || !candidate)
+         tree may_be_zero = niter_desc.may_be_zero;
+         if ((may_be_zero && integer_zerop (may_be_zero)) || !candidate)
            candidate = exit;
        }
     }

because niter_desc.may_be_zero is not a boolean but instead a tree that encodes
a boolean.

Due to this we were forcing much more complicated loops than required.  However
we *should* be able to handle these complicated loops since we don't know when
they'll occur.. so I'll post a companion patch to fix those too.

  parent reply	other threads:[~2023-12-28 18:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 16:16 [Bug tree-optimization/113137] New: " sjames at gcc dot gnu.org
2023-12-25 16:43 ` [Bug tree-optimization/113137] " sjames at gcc dot gnu.org
2023-12-26 14:05 ` tnfchris at gcc dot gnu.org
2023-12-26 14:06 ` tnfchris at gcc dot gnu.org
2023-12-26 14:06 ` tnfchris at gcc dot gnu.org
2023-12-26 14:23 ` tnfchris at gcc dot gnu.org
2023-12-26 14:27 ` tnfchris at gcc dot gnu.org
2023-12-27 12:08 ` tnfchris at gcc dot gnu.org
2023-12-27 21:13 ` dcb314 at hotmail dot com
2023-12-28 14:27 ` tnfchris at gcc dot gnu.org
2023-12-28 18:08 ` tnfchris at gcc dot gnu.org [this message]
2023-12-29 12:16 ` tnfchris at gcc dot gnu.org
2023-12-29 13:42 ` tnfchris at gcc dot gnu.org
2023-12-29 21:06 ` tnfchris at gcc dot gnu.org
2024-01-12  9:00 ` dcb314 at hotmail dot com
2024-01-12 11:09 ` tnfchris at gcc dot gnu.org
2024-01-12 15:32 ` cvs-commit at gcc dot gnu.org
2024-01-12 15:35 ` tnfchris 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-113137-4-YYoJneWG7x@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).