From: Palmer Dabbelt <palmer@rivosinc.com>
To: Vineet Gupta <vineetg@rivosinc.com>
Cc: gcc-patches@gcc.gnu.org, Kito Cheng <kito.cheng@gmail.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>,
philipp.tomsich@vrull.eu, christoph.muellner@vrull.eu,
collison@rivosinc.com, gnu-toolchain@rivosinc.com,
Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH 2/2] RISC-V: remove CM_PIC as it doesn't do much
Date: Wed, 31 Aug 2022 07:57:39 -0700 (PDT) [thread overview]
Message-ID: <mhng-74ad288d-c4ac-46d1-905a-fe1f83752c7a@palmer-mbp2014> (raw)
In-Reply-To: <20220830174830.224541-3-vineetg@rivosinc.com>
On Tue, 30 Aug 2022 10:48:30 PDT (-0700), Vineet Gupta wrote:
> CM_PIC is no longer doing anything directly. Removing it might
> potentially affect USE_LOAD_ADDRESS_MACRO() but seems unlikely.
At least in the short term, there's kind of a mess here that needs to
get sorted out but just removing CM_PIC doesn't really get us there.
> Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
> ---
> gcc/config/riscv/riscv-c.cc | 4 ----
> gcc/config/riscv/riscv-opts.h | 3 +--
> gcc/config/riscv/riscv.cc | 2 +-
> 3 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-c.cc b/gcc/config/riscv/riscv-c.cc
> index bba72cf77a82..7064fcf142fe 100644
> --- a/gcc/config/riscv/riscv-c.cc
> +++ b/gcc/config/riscv/riscv-c.cc
> @@ -92,13 +92,9 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile)
> builtin_define ("__riscv_cmodel_medlow");
> break;
>
> - case CM_PIC:
> - /* FALLTHROUGH. */
> -
> case CM_MEDANY:
> builtin_define ("__riscv_cmodel_medany");
> break;
> -
> }
>
> if (TARGET_MIN_VLEN != 0)
> diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h
> index 85e869e62e3a..ce3237beca7a 100644
> --- a/gcc/config/riscv/riscv-opts.h
> +++ b/gcc/config/riscv/riscv-opts.h
> @@ -34,8 +34,7 @@ extern enum riscv_abi_type riscv_abi;
>
> enum riscv_code_model {
> CM_MEDLOW,
> - CM_MEDANY,
> - CM_PIC
> + CM_MEDANY
> };
> extern enum riscv_code_model riscv_cmodel;
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 7c120eaa8e33..a239fe43047c 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -5162,7 +5162,7 @@ riscv_option_override (void)
> init_machine_status = &riscv_init_machine_status;
>
> if (flag_pic)
> - riscv_cmodel = CM_PIC;
> + riscv_cmodel = CM_MEDANY;
>
> /* We get better code with explicit relocs for CM_MEDLOW, but
> worse code for the others (for now). Pick the best default. */
I'm fine either way on this one: having CM_PIC gone makes it a bit more
likely to confuse CM_MEDANY with PIC, but flag_pic is overriding
riscv_cmodel anyway so this isn't really used and deleting code is
always a plus.
next prev parent reply other threads:[~2022-08-31 14:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 17:48 [PATCH 0/2] PIC cleanup Vineet Gupta
2022-08-30 17:48 ` [PATCH 1/2] RISC-V: remove deprecate pic code model macro Vineet Gupta
2022-08-31 14:57 ` Palmer Dabbelt
2022-08-31 15:35 ` Kito Cheng
2022-09-02 20:33 ` [PATCH v2] " Vineet Gupta
2022-09-02 21:03 ` Andreas Schwab
2022-09-02 21:05 ` [PATCH v3] " Vineet Gupta
2022-09-23 18:07 ` Vineet Gupta
2022-10-05 2:24 ` Kito Cheng
2022-10-05 3:33 ` Vineet Gupta
2022-08-31 20:36 ` [PATCH 1/2] " Vineet Gupta
2022-08-30 17:48 ` [PATCH 2/2] RISC-V: remove CM_PIC as it doesn't do much Vineet Gupta
2022-08-31 14:57 ` Palmer Dabbelt [this message]
2022-08-31 20:39 ` Vineet Gupta
2022-09-02 20:38 ` Vineet Gupta
2022-09-02 23:08 ` [PATCH] RISC-V: make USE_LOAD_ADDRESS_MACRO easier to understand Vineet Gupta
2022-09-23 16:01 ` Kito Cheng
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=mhng-74ad288d-c4ac-46d1-905a-fe1f83752c7a@palmer-mbp2014 \
--to=palmer@rivosinc.com \
--cc=christoph.muellner@vrull.eu \
--cc=collison@rivosinc.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu-toolchain@rivosinc.com \
--cc=jim.wilson.gcc@gmail.com \
--cc=kito.cheng@gmail.com \
--cc=philipp.tomsich@vrull.eu \
--cc=vineetg@rivosinc.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).