[07/44] RISC-V: Use `nullptr' in `riscv_expand_conditional_move'

Message ID alpine.DEB.2.20.2311171447330.5892@tpp.orcam.me.uk
State Committed
Commit 5a21d507561883460411921a291bfd50a9a1d429
Delegated to: Kito Cheng
Headers
Series RISC-V: Various if-conversion fixes and improvements |

Checks

Context Check Description
rivoscibot/toolchain-ci-rivos-apply-patch success Patch applied
rivoscibot/toolchain-ci-rivos-lint success Lint passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gc-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc_zba_zbb_zbc_zbs-lp64d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv32gc_zba_zbb_zbc_zbs-ilp32d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gcv-lp64d-multilib success Build passed

Commit Message

Maciej W. Rozycki Nov. 19, 2023, 5:36 a.m. UTC
  Use `nullptr' for consistency rather than 0 to initialize `invert_ptr'.

	gcc/
	* config/riscv/riscv.cc (riscv_expand_conditional_move): Use 
	`nullptr' rather than 0 to initialize a pointer.
---
 gcc/config/riscv/riscv.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-riscv-expand-conditional-move-nullptr.diff
  

Comments

Kito Cheng Nov. 19, 2023, 5:53 a.m. UTC | #1
LGTM

On Sun, Nov 19, 2023 at 1:37 PM Maciej W. Rozycki <macro@embecosm.com> wrote:
>
> Use `nullptr' for consistency rather than 0 to initialize `invert_ptr'.
>
>         gcc/
>         * config/riscv/riscv.cc (riscv_expand_conditional_move): Use
>         `nullptr' rather than 0 to initialize a pointer.
> ---
>  gcc/config/riscv/riscv.cc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> gcc-riscv-expand-conditional-move-nullptr.diff
> Index: gcc/gcc/config/riscv/riscv.cc
> ===================================================================
> --- gcc.orig/gcc/config/riscv/riscv.cc
> +++ gcc/gcc/config/riscv/riscv.cc
> @@ -4024,7 +4024,7 @@ riscv_expand_conditional_move (rtx dest,
>        if (!equality_operator (op, VOIDmode) || op1 != CONST0_RTX (mode))
>         {
>           enum rtx_code new_code = NE;
> -         bool *invert_ptr = 0;
> +         bool *invert_ptr = nullptr;
>           bool invert = false;
>
>           if (code == LE || code == GE)
  

Patch

Index: gcc/gcc/config/riscv/riscv.cc
===================================================================
--- gcc.orig/gcc/config/riscv/riscv.cc
+++ gcc/gcc/config/riscv/riscv.cc
@@ -4024,7 +4024,7 @@  riscv_expand_conditional_move (rtx dest,
       if (!equality_operator (op, VOIDmode) || op1 != CONST0_RTX (mode))
 	{
 	  enum rtx_code new_code = NE;
-	  bool *invert_ptr = 0;
+	  bool *invert_ptr = nullptr;
 	  bool invert = false;
 
 	  if (code == LE || code == GE)