public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [committed] i386: Remove *stack_protect_set_4s_<mode>_di alternative that will never match
Date: Sun, 12 Nov 2023 18:21:14 +0100	[thread overview]
Message-ID: <CAFULd4ZYjRjrBq1epVur51J0Q5NeGQyT6YmUrqbQJAPDhBHKfQ@mail.gmail.com> (raw)

[-- 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")])

                 reply	other threads:[~2023-11-12 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAFULd4ZYjRjrBq1epVur51J0Q5NeGQyT6YmUrqbQJAPDhBHKfQ@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).