From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 8FF753858D1E for ; Mon, 17 Jul 2023 06:32:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FF753858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-262fa79e97fso1920754a91.2 for ; Sun, 16 Jul 2023 23:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689575523; x=1692167523; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Rh0k3WyAPdTzIBCKPKyZROo31nk6m3gxTq7hyUULTqY=; b=M1TOC0FDOqnkZwYRR+Ga+QOvV6bAcpuwIph9jecyF6d9aKQvExautmuGOTbCOlyDxD b2cKRU70qOtj2bTll3rRcmC47i3801Lpqoan82mZoXZlRAcpGSoL5H+IyWwlARGzUfD/ lK4LDc0/megPdhJF12W7ZvQTVoUoib2KXH9w6kpMhnfZPOGMHeWvlTq7CAjjiw559Vrd Uf5yO2CdJvaX13x7bgOcgqDIypapDsZC10qdCtdk4L/NB6T9sOO42guJCSJtz+teKiyl x+Xpu6rLVkuYFw2ufjYwOD1xPaMDXOUgA/fvMX+XE9iz/B4GvBrFDIjFLxh+10na6KNC hr+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689575523; x=1692167523; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rh0k3WyAPdTzIBCKPKyZROo31nk6m3gxTq7hyUULTqY=; b=jDO2vL9LEdNVwLLcXID+3/j8wE+ZSl39k+DcOq7x3y8v5h5rUGJYhqZ06Xjpwy6FWY PKBByHEA4LtE5aL6eRmPxd1c5LQbhe0FeawwCfO9DopvD0WUPMxlH/8DKYIO/ucHnIDk mft+rT5P+Dv7xAM7tWQAweYMlEUl1on6/TOseQAZ2jQXIvWxG7rJgVePYJbsnKHvN4nM ExRKTuArV0w3cmu9nyqIbMhUCixXldGSt8qmdCn1iJBoJJBf1BHSqb5OwNHu6pByzfaY P6wtyLLZT0UScfwK7D5EpIezFioA61YP5p/rnUXRawD9uPKIiIDWCgfsFsEdB1O7vAXj qTwQ== X-Gm-Message-State: ABy/qLayr0nVaRZ1ESBTWHfqMpxwEVuPuwdyCdXKebQhZy86/ysbXPAr nZGK/XPgi+F7Odvl2BiMAdeHuz2Um4PFWS8UHBc= X-Google-Smtp-Source: APBJJlHvo29yPlhOFaBuUc1NGQo+KX0NL4BD/SBRFYaB9seOnAqSar1EPZHouetfgh1tb3vz+8hQauKqhR+XUR4hNg0= X-Received: by 2002:a17:90a:9ab:b0:263:5efe:5ff with SMTP id 40-20020a17090a09ab00b002635efe05ffmr7679559pjo.33.1689575523272; Sun, 16 Jul 2023 23:32:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 17 Jul 2023 08:31:31 +0200 Message-ID: Subject: Re: [PATCH] core: Support heap-based trampolines To: FX Coudert Cc: gcc-patches@gcc.gnu.org, Iain Sandoe , maxim.blinov@embecosm.com, ebotcazou@adacore.com, Jeff Law Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Jul 16, 2023 at 12:39=E2=80=AFPM FX Coudert via Gcc-patches wrote: > > Hi, > > This is a reworked version (following review) of the patch by Maxim Blino= v and Iain Sandoe enabling heap-based trampolines. What has changed since t= he last version: > > - wording changes, preferring to use =E2=80=9Cheap-based trampolines=E2= =80=9D rather than =E2=80=9Coff-stack trampolines=E2=80=9D > - the option triggering generation of these new trampolines is now a bina= ry choice: -ftrampoline-impl=3D[stack|heap] > - some adjustments due to changes in the macOS build flags in GCC since l= ast year > > Regarding testing, this patch has had excellent exposure on darwin (both = x86_64 and aarch64) because it was part of Iain=E2=80=99s branch, distribut= ed by many macOS distros/vendors (including Homebrew) for more than a year,= and there was no bug report against the feature or implementation. On x86_= 64-linux, I have regression-tested it in three different configurations: > - a default build > - a build with --enable-heap-trampolines > - a build with --enable-heap-trampolines and heap trampolines forced by d= efault (forcing HEAP_TRAMPOLINES_INIT =3D 1) > > There are no regressions in any of these settings (apart from an expected= missing warning in gcc.dg/Wtrampolines.c). > > ---------- > > From the original review, one question asked (by Jeff Law) was: whether t= he two linux implementations should be dropped, and the configure time > selectability as well. Regardless of the answer to the first question, I = think we probably want to retain the later, even if only for darwin, as we = want to implement this only on recent darwin versions. Since this affects the ABI of libgcc I think we don't want that part to be user configurable but rather determined by some static list of targets that opt-in to this config. You mention setjmp/longjmp - on darwin and other platforms requiring non-stack based trampolines does the system runtime provide means to deal with this issue like an alternate allocation method or a way to register cleanup? Was there ever an attempt to provide a "generic" trampoline driven by a more complex descriptor? (well, it could be a bytecode interpreter and the trampoline being bytecode on the stack?!) Otherwise I suggest to split the patch into libgcc, generic and target part= s. Thanks, Richard. > > OK to commit? > > FX > >