https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124336

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |uros at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
orl rather than orq is one byte shorter, dunno if there are advantages of using
orq over orl.

So, either we go for size and use something like
--- gcc/config/i386/i386.cc.jj  2026-03-02 07:43:12.329788348 +0100
+++ gcc/config/i386/i386.cc     2026-03-02 20:44:52.866495774 +0100
@@ -8438,7 +8438,7 @@ output_adjust_stack_and_probe (rtx reg)

   /* Probe at SP.  */
   xops[1] = const0_rtx;
-  output_asm_insn ("or%z0\t{%1, (%0)|DWORD PTR [%0], %1}", xops);
+  output_asm_insn ("or{l}\t{%1, (%0)|DWORD PTR [%0], %1}", xops);

   /* Test if SP == LAST_ADDR.  */
   xops[0] = stack_pointer_rtx;
@@ -8574,7 +8574,7 @@ output_probe_stack_range (rtx reg, rtx e
   xops[0] = stack_pointer_rtx;
   xops[1] = reg;
   xops[2] = const0_rtx;
-  output_asm_insn ("or%z0\t{%2, (%0,%1)|DWORD PTR [%0+%1], %2}", xops);
+  output_asm_insn ("or{l}\t{%2, (%0,%1)|DWORD PTR [%0+%1], %2}", xops);

   /* Test if TEST_ADDR == LAST_ADDR.  */
   xops[0] = reg;
--- gcc/config/i386/i386.md.jj  2026-01-29 09:37:35.297819396 +0100
+++ gcc/config/i386/i386.md     2026-03-02 20:56:36.827754830 +0100
@@ -27798,23 +27798,23 @@ (define_expand "probe_stack"
   [(match_operand 0 "memory_operand")]
   ""
 {
-  emit_insn (gen_probe_stack_1
-            (word_mode, operands[0], const0_rtx));
+  emit_insn (gen_probe_stack_1 (adjust_address (operands[0], SImode, 0),
+                               const0_rtx));
   DONE;
 })

 ;; Use OR for stack probes, this is shorter.
-(define_insn "@probe_stack_1_<mode>"
-  [(set (match_operand:W 0 "memory_operand" "=m")
-       (unspec:W [(match_operand:W 1 "const0_operand")]
+(define_insn "probe_stack_1"
+  [(set (match_operand:SI 0 "memory_operand" "=m")
+       (unspec:SI [(match_operand:SI 1 "const0_operand")]
                  UNSPEC_PROBE_STACK))
    (clobber (reg:CC FLAGS_REG))]
   ""
-  "or{<imodesuffix>}\t{%1, %0|%0, %1}"
+  "or{l}\t{%1, %0|%0, %1}"
   [(set_attr "type" "alu1")
-   (set_attr "mode" "<MODE>")
+   (set_attr "mode" "SI")
    (set_attr "length_immediate" "1")])
-  
+
 (define_insn "@adjust_stack_and_probe_<mode>"
   [(set (match_operand:P 0 "register_operand" "=r")
        (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]

or we make -masm=intel match -masm=att and in that case the 2 spots with
hardcoded DWORD PTR would need to conditionalize that or QWORD PTR based on
stack_pointer_rtx mode.

Reply via email to