This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC patch committed: fix unwind info for 32-bit x86 split stack


With a new libgo patch (waiting to be committed until we are out of
stage 4) I noticed that the runtime/pprof tests were failing about 2%
of the time on 32-bit x86.  The problem turned out to be testing
profiling with a very call-heavy benchmark.  The 32-bit x86 split
stack sequence pushes two numbers on the stack as arguments to the
__morestack function.  GCC was not generating unwind information for
those push instructions.  When the SIGPROF signal was delivered while
executing the second push instruction or the call instruction, the
unwinder would be unable to locate the PC and would crash.

Fortunately this is easy to fix as the instructions always run at the
very beginning of the function, before any stack manipulation has
occurred.  I have committed this patch to fix the problem.
Bootstrapped on x86_64-pc-linux-gnu.  Ran the Go testsuite and all the
split-stack tests in both 32-bit and 64-bit mode.

Ian

2017-01-31  Ian Lance Taylor  <iant@golang.org>

    * config/i386/i386.c (ix86_expand_split_stack_prologue): Add
    REG_ARGS_SIZE note to 32-bit push insns and call insn.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]