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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, the diff in that revision is
--- pr126270.s_ 2026-07-28 08:51:39.659185372 -0400
+++ pr126270.s  2026-07-28 08:52:02.861496278 -0400
@@ -37,7 +37,6 @@ main:
        movl    %r9d, %eax
 .L8:
        notl    %eax
-       movsbl  %al, %eax
        addl    %esi, %eax
        subl    %ecx, %eax
        movl    %eax, j(%rip)
In mode_sw dump the first difference is
-(insn 61 60 62 14 (set (reg:QI 125 [ l_27 ])
-        (not:QI (subreg:QI (reg:SI 108 [ iftmp.6_16 ]) 0))) "pr126270.c":13:5
discrim 8 1045 {*one_cmplqi2_1}
-     (expr_list:REG_DEAD (reg:SI 108 [ iftmp.6_16 ])
-        (nil)))
+(note 61 60 62 14 NOTE_INSN_DELETED)
 (insn 62 61 63 14 (set (reg:SI 126 [ _10 ])
-        (sign_extend:SI (reg:QI 125 [ l_27 ]))) "pr126270.c":14:9 195
{extendqisi2}
-     (expr_list:REG_DEAD (reg:QI 125 [ l_27 ])
+        (not:SI (reg:SI 108 [ iftmp.6_16 ]))) "pr126270.c":14:9 1037
{*one_cmplsi2_1}
+     (expr_list:REG_DEAD (reg:SI 108 [ iftmp.6_16 ])
         (nil)))
Now, I see before this
(insn 5 53 54 11 (set (reg:SI 108 [ iftmp.6_16 ])
        (const_int 0 [0])) "pr126270.c":13:23 discrim 7 100 {*movsi_internal}
     (nil))
and
(insn 31 30 114 7 (set (reg:SI 131 [ iftmp.6_16 ])
        (zero_extend:SI (reg:QI 118 [ _74 ]))) "pr126270.c":12:13 discrim 1 184
{*zero_extendqisi2}
     (nil))
and
(insn 109 57 59 13 (set (reg:SI 108 [ iftmp.6_16 ])
        (reg:SI 131 [ iftmp.6_16 ])) "pr126270.c":13:23 discrim 5 100
{*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 131 [ iftmp.6_16 ])
        (expr_list:REG_EQUAL (zero_extend:SI (reg:QI 118 [ _74 ]))
            (nil))))
and
(insn 113 118 56 12 (set (reg:SI 131 [ iftmp.6_16 ])
        (subreg:SI (reg:QI 118 [ _74 ]) 0)) 100 {*movsi_internal}
     (nil))
Now, even if at that point the upper 24 bits of SI 108 are guaranteed to be
zero (which I'm not that sure about because of the paradoxical subreg in isns
113), I think
(sign_extend:SI (not:QI (subreg:QI (reg:SI 108) 0))) is not equivalent to
(not:SI (reg:SI 108)), it will be only if not just the upper 24 bits of r108
are guaranteed to be zero, but if upper 25 bits are.

Reply via email to