]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r265322 from llvm upstream
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 May 2016 21:45:34 +0000 (21:45 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 May 2016 21:45:34 +0000 (21:45 +0000)
Since x86 psABIs require the function incoming stack must align at 16
bytes, child process stack passed to clone should be aligned at 16
bytes.

PR testsuite/70520
* c-c++-common/asan/clone-test-1.c (main): Align child process
stack to 16 bytes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235790 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/asan/clone-test-1.c

index 4bd9f88af496000eb729ebc9dc116399b248cecc..7bc4374dbd7a34d4feaeec11041b9d34073a734d 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR testsuite/70520
+       * c-c++-common/asan/clone-test-1.c (main): Align child process
+       stack to 16 bytes.
+
 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/62314
index fd187aaadd2d7ffca62f4cecc308555e35f05ad6..eeca09f3e689009543faa5f206f433c1c79fc6a2 100644 (file)
@@ -25,7 +25,7 @@ volatile int zero = 0;
 int main(int argc, char **argv) {
   int i;
   const int kStackSize = 1 << 20;
-  char child_stack[kStackSize + 1];
+  char __attribute__((aligned(16))) child_stack[kStackSize + 1];
   char *sp = child_stack + kStackSize;  /* Stack grows down. */
   printf("Parent: %p\n", sp);
   pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0);