public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/114084] ICE: SIGSEGV: infinite recursion in fold_build2_loc / fold_binary_loc with _BitInt(127)
Date: Sat, 24 Feb 2024 09:34:36 +0000	[thread overview]
Message-ID: <bug-114084-4-prIHh8nHna@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114084-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Or perhaps the
          if (ok
              && ((var0 != 0) + (var1 != 0)
                  + (minus_var0 != 0) + (minus_var1 != 0)
                  + (con0 != 0) + (con1 != 0)
                  + (minus_con0 != 0) + (minus_con1 != 0)
                  + (lit0 != 0) + (lit1 != 0)
                  + (minus_lit0 != 0) + (minus_lit1 != 0)) > 2)
condition should be amended to avoid the reassociation in cases where clearly
nothing good can come out of that.  Which is if the association actually
doesn't reshuffle anything.  (var0 == 0) || (var1 == 0) && (and similarly for
the other 5 pairs) and
(ignoring the minus_* stuff that would need more thoughts on it)
(con0 != 0 && lit0 != 0) || (con1 != 0 && lit1 != 0),
then it reassociates to the original stuff in op0 and original stuff in op1,
no change.  But how the minus_* plays together with this is harder.
Perhaps if lazy we could have a bool var whether there has been any association
between subtrees from original op0 and op1, initially set to false and set if
we associate_trees between something that comes from op0 and op1, and only do
the final
associate_trees if that is the case, because if not, it should be folding of
the individual suboperands, not reassociation.

  parent reply	other threads:[~2024-02-24  9:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24  5:36 [Bug tree-optimization/114084] New: " zsojka at seznam dot cz
2024-02-24  5:53 ` [Bug middle-end/114084] " pinskia at gcc dot gnu.org
2024-02-24  6:40 ` pinskia at gcc dot gnu.org
2024-02-24  9:10 ` jakub at gcc dot gnu.org
2024-02-24  9:14 ` jakub at gcc dot gnu.org
2024-02-24  9:34 ` jakub at gcc dot gnu.org [this message]
2024-02-24 10:16 ` jakub at gcc dot gnu.org
2024-02-26  9:09 ` cvs-commit at gcc dot gnu.org
2024-02-26  9:27 ` jakub 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-114084-4-prIHh8nHna@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).