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

            Bug ID: 120734
           Summary: -m32 -march=i686 doesn't use "mov $0, mem"
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i386

[hjl@gnu-tgl-3 gcc]$ cat /tmp/x.c 
extern char *aligned_heap_area;

void
bar (void)
{
  aligned_heap_area = 0;
}
[hjl@gnu-tgl-3 gcc]$ ./xgcc -B./ -S -m32 -march=i686 -O2 /tmp/x.c
[hjl@gnu-tgl-3 gcc]$ cat x.s
        .file   "x.c"
        .text
        .p2align 4
        .globl  bar
        .type   bar, @function
bar:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        movl    %eax, aligned_heap_area
        ^^^^^^^ "movl $0, aligned_heap_area" should be used.
        ret
        .cfi_endproc
.LFE0:
        .size   bar, .-bar
        .ident  "GCC: (GNU) 16.0.0 20250620 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-tgl-3 gcc]$

Reply via email to