public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>'
@ 2022-07-26 16:59 Maciej W. Rozycki
  2022-07-26 17:12 ` Kito Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2022-07-26 16:59 UTC (permalink / raw)
  To: gcc-patches; +Cc: Kito Cheng, Palmer Dabbelt, Andrew Waterman, Jim Wilson

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"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>'
  2022-07-26 16:59 [PATCH] RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>' Maciej W. Rozycki
@ 2022-07-26 17:12 ` Kito Cheng
  2022-07-27 10:28   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Kito Cheng @ 2022-07-26 17:12 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: GCC Patches, Andrew Waterman

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"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>'
  2022-07-26 17:12 ` Kito Cheng
@ 2022-07-27 10:28   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2022-07-27 10:28 UTC (permalink / raw)
  To: Kito Cheng; +Cc: GCC Patches, Andrew Waterman

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-27 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 16:59 [PATCH] RISC-V: Remove duplicate backslashes from `stack_protect_set_<mode>' Maciej W. Rozycki
2022-07-26 17:12 ` Kito Cheng
2022-07-27 10:28   ` Maciej W. Rozycki

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).