public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Segher Boessenkool <segher@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6877] rtl: builtins: Fix builtins feclearexcept and feraiseexcept operand check [PR94193]
Date: Wed, 26 Jan 2022 15:21:07 +0000 (GMT)	[thread overview]
Message-ID: <20220126152107.32E45388C003@sourceware.org> (raw)

https://gcc.gnu.org/g:8bcf835e0a4e3334e1c60f314ae6917ba648bdde

commit r12-6877-g8bcf835e0a4e3334e1c60f314ae6917ba648bdde
Author: Raoni Fassina Firmino <raoni@linux.ibm.com>
Date:   Wed Jan 26 12:05:54 2022 -0300

    rtl: builtins: Fix builtins feclearexcept and feraiseexcept operand check [PR94193]
    
    Commit 4343f5e25679 ("rtl: builtins: (not just) rs6000: Add builtins
    for fegetround, feclearexcept and feraiseexcept [PR94193]") broke gcc
    bootstra when building with --enable-checking=rtl[1].
    
    The function expand_builtin_feclear_feraise_except was failing to
    proper validate op0 predicate before emit_insn leading to the mismatch
    type failure.
    
    [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589186.html
    
    2022-01-26  Raoni Fassina Firmino  <raoni@linux.ibm.com>
    
    gcc/
            PR target/94193
            * builtins.cc (expand_builtin_feclear_feraise_except): Add op0
            predicate check.
    
    Signed-off-by: Raoni Fassina Firmino <raoni@linux.ibm.com>

Diff:
---
 gcc/builtins.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/builtins.cc b/gcc/builtins.cc
index e84208035da..d784a57c2b8 100644
--- a/gcc/builtins.cc
+++ b/gcc/builtins.cc
@@ -2598,6 +2598,9 @@ expand_builtin_feclear_feraise_except (tree exp, rtx target,
   if (icode == CODE_FOR_nothing)
     return NULL_RTX;
 
+  if (!(*insn_data[icode].operand[1].predicate) (op0, GET_MODE (op0)))
+    return NULL_RTX;
+
   if (target == 0
       || GET_MODE (target) != target_mode
       || !(*insn_data[icode].operand[0].predicate) (target, target_mode))


                 reply	other threads:[~2022-01-26 15:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220126152107.32E45388C003@sourceware.org \
    --to=segher@gcc.gnu.org \
    --cc=gcc-cvs@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).