From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id 1E958384B106; Thu, 28 Jan 2021 17:32:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E958384B106 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/users/ibuclaw/heads/darwin X-Git-Oldrev: c73e3504b5b1cb2d6fe8787525c534bc0f7d090f X-Git-Newrev: 374d224413b80ef479c460e067f61b2937ba8e9f Message-Id: <20210128173209.1E958384B106@sourceware.org> Date: Thu, 28 Jan 2021 17:32:09 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2021 17:32:09 -0000 https://gcc.gnu.org/g:374d224413b80ef479c460e067f61b2937ba8e9f commit 374d224413b80ef479c460e067f61b2937ba8e9f Author: Iain Buclaw Date: Wed Dec 9 10:49:34 2020 +0100 libphobos: Fix broken ucontext implementation, and other small test fixes Diff: --- libphobos/libdruntime/core/thread/fiber.d | 1 + libphobos/libdruntime/core/thread/threadbase.d | 1 + libphobos/src/std/experimental/allocator/package.d | 3 ++- libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d index 3270f2e7094..2b475ca82cb 100644 --- a/libphobos/libdruntime/core/thread/fiber.d +++ b/libphobos/libdruntime/core/thread/fiber.d @@ -883,6 +883,7 @@ class Fiber */ static Fiber getThis() @safe nothrow @nogc { + version (GNU) pragma(inline, false); return sm_this; } diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d index c2c2333efe9..50795e444be 100644 --- a/libphobos/libdruntime/core/thread/threadbase.d +++ b/libphobos/libdruntime/core/thread/threadbase.d @@ -313,6 +313,7 @@ class ThreadBase // NOTE: This function may not be called until thread_init has // completed. See thread_suspendAll for more information // on why this might occur. + version (GNU) pragma(inline, false); return sm_this; } diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d index 11c85474365..7c404070ffa 100644 --- a/libphobos/src/std/experimental/allocator/package.d +++ b/libphobos/src/std/experimental/allocator/package.d @@ -622,7 +622,8 @@ allocator can be cast to $(D shared). testAllocatorObject(processAllocator); testAllocatorObject(theAllocator); - assertThrown!AssertError(processAllocator = null); + // XBUG: Asserts are not thrown in release code, so is a pointless check. + //assertThrown!AssertError(processAllocator = null); // Restore initial processAllocator state processAllocator = oldProcessAllocator; diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d index 9f754e155d2..ca54a19857f 100644 --- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d +++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d @@ -1,13 +1,15 @@ // { dg-options "-O0" } // { dg-shouldfail "segv or bus error" } import core.thread; +import core.sys.posix.signal; import core.sys.posix.sys.mman; // this should be true for most architectures // (taken from core.thread) -version = StackGrowsDown; +version (GNU_StackGrowsDown) + version = StackGrowsDown; -enum stackSize = 4096; +enum stackSize = MINSIGSTKSZ; // Simple method that causes a stack overflow void stackMethod()