public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] i386: Remove *stack_protect_set_4s_<mode>_di alternative that will never match
@ 2023-11-12 17:21 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2023-11-12 17:21 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

The relevant peephole2 will never generate alternative (=m,=&a,0,m) because
operand 1 is not dead before the peephole2 pattern.

gcc/ChangeLog:

* config/i386/i386.md (*stack_protect_set_4s_<mode>_di):
Remove alternative 0.

Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1223 bytes --]

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 01fc6ecc351..ffd9f2d0381 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -24481,19 +24481,16 @@ (define_insn "*stack_protect_set_4z_<mode>_di"
    (set_attr "length" "24")])
 
 (define_insn "*stack_protect_set_4s_<mode>_di"
-  [(set (match_operand:PTR 0 "memory_operand" "=m,m")
-	(unspec:PTR [(match_operand:PTR 3 "memory_operand" "m,m")]
+  [(set (match_operand:PTR 0 "memory_operand" "=m")
+	(unspec:PTR [(match_operand:PTR 3 "memory_operand" "m")]
 		    UNSPEC_SP_SET))
-   (set (match_operand:DI 1 "register_operand" "=&a,&r")
-	(sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "0,rm")))]
+   (set (match_operand:DI 1 "register_operand" "=&r")
+	(sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm")))]
   "TARGET_64BIT && reload_completed"
 {
   output_asm_insn ("mov{<imodesuffix>}\t{%3, %<k>1|%<k>1, %3}", operands);
   output_asm_insn ("mov{<imodesuffix>}\t{%<k>1, %0|%0, %<k>1}", operands);
-  if (which_alternative)
-    return "movs{lq|x}\t{%2, %1|%1, %2}";
-  else
-    return "{cltq|cdqe}";
+  return "movs{lq|x}\t{%2, %1|%1, %2}";
 }
   [(set_attr "type" "multi")
    (set_attr "length" "24")])

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-12 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 17:21 [committed] i386: Remove *stack_protect_set_4s_<mode>_di alternative that will never match Uros Bizjak

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