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

            Bug ID: 84128
           Summary: i686: Stack spilling in -fstack-clash-protection
                    prologue neglects %esp change
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: law at redhat dot com
          Reporter: fw at gcc dot gnu.org
  Target Milestone: ---
            Target: i686

Created attachment 43291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43291&action=edit
Reproducer

The attached test case (compile with -m32 -march=i686 -mtune=generic
-fstack-clash-protection -O2) shows that %eax is popped off the stack in the
stack-clash protection prologue after %esp has been moved:

f1:
.LFB0:
        .cfi_startproc
        pushl   %eax
        .cfi_def_cfa_offset 8
        .cfi_offset 0, -8
        leal    -32768(%esp), %eax
        .cfi_def_cfa 0, 32776
.LPSRL0:
        subl    $4096, %esp
        orl     $0, (%esp)
        cmpl    %eax, %esp
        jne     .LPSRL0
        .cfi_def_cfa_register 4
        subl    $12, %esp
        .cfi_def_cfa_offset 32788
        popl    %eax

Is this a missing stack tie?

Seen with trunk@257087.  Test case reduced from a miscompilation of pcre2.

Reply via email to