public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/101008] ICE: in native_encode_rtx, at simplify-rtx.c:6594 with -O -g
Date: Fri, 11 Jun 2021 11:00:27 +0000	[thread overview]
Message-ID: <bug-101008-4-Gr6Yqsb9oR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101008-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:4bdcdd8fa8d7659e5a19a930cf2f0332127f8a46

commit r12-1386-g4bdcdd8fa8d7659e5a19a930cf2f0332127f8a46
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jun 11 12:59:43 2021 +0200

    simplify-rtx: Fix up simplify_logical_relational_operation for vector IOR
[PR101008]

    simplify_relational_operation callees typically return just const0_rtx
    or const_true_rtx and then simplify_relational_operation attempts to fix
    that up if the comparison result has vector mode, or floating mode,
    or punt if it has scalar mode and vector mode operands (it doesn't know how
    exactly to deal with the scalar masks).
    But, simplify_logical_relational_operation has a special case, where
    it attempts to fold (x < y) | (x >= y) etc. and if it determines it is
    always true, it just returns const_true_rtx, without doing the dances that
    simplify_relational_operation does.
    That results in an ICE on the following testcase, where such folding
happens
    during expansion (of debug stmts into DEBUG_INSNs) and we ICE because
    all of sudden a VOIDmode rtx appears where it expects a vector (V4SImode)
    rtx.

    The following patch fixes that by moving the adjustement into a separate
    helper routine and using it from both simplify_relational_operation and
    simplify_logical_relational_operation.

    2021-06-11  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/101008
            * simplify-rtx.c (relational_result): New function.
            (simplify_logical_relational_operation,
            simplify_relational_operation): Use it.

            * gcc.dg/pr101008.c: New test.

  parent reply	other threads:[~2021-06-11 11:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  6:00 [Bug rtl-optimization/101008] New: " zsojka at seznam dot cz
2021-06-10  7:02 ` [Bug rtl-optimization/101008] " rguenth at gcc dot gnu.org
2021-06-10 10:37 ` jakub at gcc dot gnu.org
2021-06-10 12:37 ` jakub at gcc dot gnu.org
2021-06-11 11:00 ` cvs-commit at gcc dot gnu.org [this message]
2021-06-11 12:10 ` jakub at gcc dot gnu.org
2021-06-17  5:59 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:18 ` cvs-commit at gcc dot gnu.org
2022-10-28 23:25 ` pinskia 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-101008-4-Gr6Yqsb9oR@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).