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 target/106586] riscv32 still broke with zba_zbb_zbc_zbs, ICE in do_SUBST in C++ code
Date: Wed, 24 Aug 2022 19:20:40 +0000	[thread overview]
Message-ID: <bug-106586-4-YQZPmLdO5s@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106586-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:2c721ea9473ad7615bb47b66509097bd254bb839

commit r13-2188-g2c721ea9473ad7615bb47b66509097bd254bb839
Author: Andrew Pinski <apinski@marvell.com>
Date:   Mon Aug 15 22:25:13 2022 +0000

    [RISCV] Fix PR 106586: riscv32 vs ZBS

    The problem here is two fold. With RISCV32, 32bit
    const_int are always signed extended to 64bit in HWI.
    So that means for SINGLE_BIT_MASK_OPERAND, it should
    mask off the upper bits to see it is a single bit
    for !TARGET_64BIT.
    Plus there are a few locations which forget to call
    trunc_int_for_mode when generating a SImode constant
    so they are not sign extended correctly for HWI.
    The predicates single_bit_mask_operand and
    not_single_bit_mask_operand need get the same handling
    as SINGLE_BIT_MASK_OPERAND so just use SINGLE_BIT_MASK_OPERAND.

    OK? Built and tested on riscv32-linux-gnu and riscv64-linux-gnu with
    --with-arch=rvNimafdc_zba_zbb_zbc_zbs where N is replaced with 32 or 64.

    Thanks,
    Andrew Pinski

    gcc/ChangeLog:

            PR target/106586
            * config/riscv/predicates.md (single_bit_mask_operand):
            Use SINGLE_BIT_MASK_OPERAND instead of directly calling pow2p_hwi.
            (not_single_bit_mask_operand): Likewise.
            * config/riscv/riscv.cc (riscv_build_integer_1): Don't special case
            1<<31 for 32bits as it is already handled.
            Call trunc_int_for_mode on the upper part after the subtraction.
            (riscv_move_integer): Call trunc_int_for_mode before generating
            the integer just make sure the constant has been sign extended
            corectly.
            (riscv_emit_int_compare): Call trunc_int_for_mode after doing the
            addition for the new rhs.
            * config/riscv/riscv.h (SINGLE_BIT_MASK_OPERAND): If !TARGET64BIT,
            then mask off the upper 32bits of the HWI as it will be sign
extended.

  parent reply	other threads:[~2022-08-24 19:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 17:40 [Bug target/106586] New: " pinskia at gcc dot gnu.org
2022-08-11 17:42 ` [Bug target/106586] " pinskia at gcc dot gnu.org
2022-08-11 17:46 ` pinskia at gcc dot gnu.org
2022-08-11 18:37 ` pinskia at gcc dot gnu.org
2022-08-11 18:47 ` pinskia at gcc dot gnu.org
2022-08-11 19:14 ` pinskia at gcc dot gnu.org
2022-08-11 22:16 ` pinskia at gcc dot gnu.org
2022-08-12  1:48 ` jiawei at iscas dot ac.cn
2022-08-12  1:55 ` pinskia at gcc dot gnu.org
2022-08-15 18:58 ` pinskia at gcc dot gnu.org
2022-08-15 21:37 ` pinskia at gcc dot gnu.org
2022-08-15 22:13 ` pinskia at gcc dot gnu.org
2022-08-15 22:20 ` pinskia at gcc dot gnu.org
2022-08-15 23:16 ` pinskia at gcc dot gnu.org
2022-08-24 19:20 ` cvs-commit at gcc dot gnu.org [this message]
2022-08-24 19:21 ` 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-106586-4-YQZPmLdO5s@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).