public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: pan2.li@intel.com, gcc-patches@gcc.gnu.org
Cc: juzhe.zhong@rivai.ai, yanzhang.wang@intel.com, kito.cheng@gmail.com
Subject: Re: [PATCH v1] RISC-V: Bugfix for legitimize address PR/111634
Date: Fri, 6 Oct 2023 22:53:22 -0600	[thread overview]
Message-ID: <8fd01f6e-8d10-4e6a-a73a-fc68652fca1a@gmail.com> (raw)
In-Reply-To: <20231007044943.4153909-1-pan2.li@intel.com>



On 10/6/23 22:49, pan2.li@intel.com wrote:
> From: Pan Li <pan2.li@intel.com>
> 
> Given we have RTL as below.
> 
> (plus:DI (mult:DI (reg:DI 138 [ g.4_6 ])
>                    (const_int 8 [0x8]))
>           (lo_sum:DI (reg:DI 167)
>                      (symbol_ref:DI ("f") [flags 0x86] <var_decl 0x7fa96ea1cc60 f>)
> ))
> 
> When handling (plus (plus (mult (a) (mem_shadd_constant)) (fp)) (C)) case,
> the fp will be the lo_sum operand as above. We have assumption that the fp
> is reg but actually not here. It will have ICE when building with option
> --enable-checking=rtl.
> 
> This patch would like to fix it by adding the REG_P to ensure the operand
> is a register. The test case gcc/testsuite/gcc.dg/pr109417.c covered this
> fix when build with --enable-checking=rtl.
> 
> 	PR target/111634
> 
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv.cc (riscv_legitimize_address): Bugfix.
OK, though the ChangeLog entry could be better.  Perhaps

	* config/riscv/riscv.cc (riscv_legitimize_address): Ensure
	object is a REG before extracting its register number.


Jeff

  reply	other threads:[~2023-10-07  4:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07  4:49 pan2.li
2023-10-07  4:53 ` Jeff Law [this message]
2023-10-07  4:58   ` Li, Pan2

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=8fd01f6e-8d10-4e6a-a73a-fc68652fca1a@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    --cc=yanzhang.wang@intel.com \
    /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).