From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id 5DCA9386F46E; Sun, 14 Mar 2021 22:00:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DCA9386F46E 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: 5d4fac63564d4d9fcb71248a31982d3d399a2cf3 X-Git-Newrev: 20170842858f4e205844cfb121f0a9092d8e4717 Message-Id: <20210314220056.5DCA9386F46E@sourceware.org> Date: Sun, 14 Mar 2021 22:00:56 +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: Sun, 14 Mar 2021 22:00:56 -0000 https://gcc.gnu.org/g:20170842858f4e205844cfb121f0a9092d8e4717 commit 20170842858f4e205844cfb121f0a9092d8e4717 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()