[Bug middle-end/94218] New: Different __builtin_setjmp/__builtin_longjmp buffer layout is suggested in case of cet.

2020-03-18 Thread gsdrtge6h at protonmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94218

Bug ID: 94218
   Summary: Different __builtin_setjmp/__builtin_longjmp buffer
layout is suggested in case of cet.
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gsdrtge6h at protonmail dot com
  Target Milestone: ---
Target: ia32

Created attachment 48058
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48058&action=edit
test for setjmp call

The current implementation layout is to put shadow stack pointer at jb + 16 and
normal stack pointer at jb + 24 when cet is enabled.

rdsspq  %rax
movq%rax, jb_extern+16(%rip)
movq%rsp, jb_extern+24(%rip)

When CET is disabled normal stack pointer goes to jb + 16.

It is suggested to switch the locations of shadow stack pointer and normal
stack pointer within the jump buffer.  This way there can be a chance to link
legacy/no-cet __builtin_longjmp() code with cet __builtin_setjmp() code.

[Bug middle-end/94218] Different __builtin_setjmp/__builtin_longjmp buffer layout is suggested in case of cet.

2020-03-18 Thread gsdrtge6h at protonmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94218

--- Comment #1 from gsdrtge6h at protonmail dot com ---
Created attachment 48059
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48059&action=edit
longjmp part of the test

[Bug target/94218] Different __builtin_setjmp/__builtin_longjmp buffer layout is suggested in case of cet.

2020-03-18 Thread gsdrtge6h at protonmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94218

--- Comment #7 from gsdrtge6h at protonmail dot com ---
Okay, but why the current layout is any better than the suggested layout.