From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id 587AE3A0702D; Sat, 10 Apr 2021 17:01:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 587AE3A0702D 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: d15e88670d50f0ab79a35ef5027b64a8e8060282 X-Git-Newrev: 3bbe5f9a4edf81a0ac13ebc9e1813dbb91225438 Message-Id: <20210410170112.587AE3A0702D@sourceware.org> Date: Sat, 10 Apr 2021 17:01:12 +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: Sat, 10 Apr 2021 17:01:12 -0000 https://gcc.gnu.org/g:3bbe5f9a4edf81a0ac13ebc9e1813dbb91225438 commit 3bbe5f9a4edf81a0ac13ebc9e1813dbb91225438 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()