diff mbox series

RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>'

Message ID alpine.DEB.2.20.2207261746530.10833@tpp.orcam.me.uk
State New
Headers show
Series RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>' | expand

Commit Message

Maciej W. Rozycki July 26, 2022, 4:59 p.m. UTC
Remove redundant duplicate backslash characters from \t sequences in the 
output pattern of the `stack_protect_set_<mode>' RTL insn.

	gcc/
	* gcc/config/riscv/riscv.md (stack_protect_set_<mode>): Remove 
	duplicate backslashes.
---
Hi,

 I don't know why it doesn't matter whether the backslash is duplicated 
here or not, but output produced in insn-output.cc is the same either way, 
with lone \t sequences present, so remove these extraneous backslashes for 
consistency.  Even this very output pattern does not have this duplication 
present in the final LI instruction.

 OK to apply?

  Maciej
---
 gcc/config/riscv/riscv.md |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-riscv-stack-protect-tab.diff

Comments

Kito Cheng July 26, 2022, 5:12 p.m. UTC | #1
Hi Maciej:

Ooops, thanks for fixing that, the change was gotten from kernel
folks. I assume they have already used that for a while, but it's
really weird no bug report from those guys...

OK for trunk and backport for release branch.

On Wed, Jul 27, 2022 at 1:00 AM Maciej W. Rozycki <macro@embecosm.com> wrote:
>
> Remove redundant duplicate backslash characters from \t sequences in the
> output pattern of the `stack_protect_set_<mode>' RTL insn.
>
>         gcc/
>         * gcc/config/riscv/riscv.md (stack_protect_set_<mode>): Remove
>         duplicate backslashes.
> ---
> Hi,
>
>  I don't know why it doesn't matter whether the backslash is duplicated
> here or not, but output produced in insn-output.cc is the same either way,
> with lone \t sequences present, so remove these extraneous backslashes for
> consistency.  Even this very output pattern does not have this duplication
> present in the final LI instruction.
>
>  OK to apply?
>
>   Maciej
> ---
>  gcc/config/riscv/riscv.md |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> gcc-riscv-stack-protect-tab.diff
> Index: gcc/gcc/config/riscv/riscv.md
> ===================================================================
> --- gcc.orig/gcc/config/riscv/riscv.md
> +++ gcc/gcc/config/riscv/riscv.md
> @@ -2851,7 +2851,7 @@
>          UNSPEC_SSP_SET))
>     (set (match_scratch:GPR 2 "=&r") (const_int 0))]
>    ""
> -  "<load>\\t%2, %1\;<store>\\t%2, %0\;li\t%2, 0"
> +  "<load>\t%2, %1\;<store>\t%2, %0\;li\t%2, 0"
>    [(set_attr "length" "12")])
>
>  (define_expand "stack_protect_test"
Maciej W. Rozycki July 27, 2022, 10:28 a.m. UTC | #2
On Wed, 27 Jul 2022, Kito Cheng wrote:

> Ooops, thanks for fixing that, the change was gotten from kernel
> folks. I assume they have already used that for a while, but it's
> really weird no bug report from those guys...
> 
> OK for trunk and backport for release branch.

 Change now committed and backported to GCC 12 & 11, thank you for your 
review.

  Maciej
diff mbox series

Patch

Index: gcc/gcc/config/riscv/riscv.md
===================================================================
--- gcc.orig/gcc/config/riscv/riscv.md
+++ gcc/gcc/config/riscv/riscv.md
@@ -2851,7 +2851,7 @@ 
 	 UNSPEC_SSP_SET))
    (set (match_scratch:GPR 2 "=&r") (const_int 0))]
   ""
-  "<load>\\t%2, %1\;<store>\\t%2, %0\;li\t%2, 0"
+  "<load>\t%2, %1\;<store>\t%2, %0\;li\t%2, 0"
   [(set_attr "length" "12")])
 
 (define_expand "stack_protect_test"