From patchwork Fri Jul 5 08:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1957150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dI6B6yCK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFn0043Hlz1xqb for ; Fri, 5 Jul 2024 18:35:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2B0F382E682 for ; Fri, 5 Jul 2024 08:35:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id CE5DD384A054 for ; Fri, 5 Jul 2024 08:34:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE5DD384A054 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE5DD384A054 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720168503; cv=none; b=pJI0hz7qrA4dqsGOHph8LimLteLaqjlX6RJV3Qb7wIOKzFU0xQQyxAEn+eIfovuoIF9EwvvgEWdY32Pnpxh/W5X2Z1XL3BF3rPguS1srsVstQ/tEXqJHSpTHWnnqjBPFWuJ+JxYuqzx/o5voOF6KnWaftdZ0FWEoczs1AcxXyA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720168503; c=relaxed/simple; bh=cqBfQzbeDd9Keu+pxFdvRXivyKISfB5N9p/C9zNLmKc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=PGn4FS0IfSDANy9yXDldWOWgTiNUGVCGNVAsFtyBSSpIo/7KsP9n1PStN2mYHPVA7tjijLx0+n6N5zi4/KWsNPjQpInxiu/1GIwBPfCaR1FokB0cVp3nF2rfaFDWwmIOaW60v+zHXKU3KUoNTLy1LZSfJOdYsFbZXcrsZow2QFI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-52e9f863c46so1444829e87.1 for ; Fri, 05 Jul 2024 01:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720168493; x=1720773293; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+p1AzrmfZodSzccwf3+VZp/d6EqLietfSstUyXtOAno=; b=dI6B6yCKoMom2NT4oGTTwiiqFIBrXmXOE1tr1FgK5qsgef5Q5OUNtWOcwXX5jjGRo9 k/goMuyUvDupJ6zdbk4J+H4rULj3UWRmG5qGF+ATK9sVZ4dvkFvTKnjE7eifCU0PP6TW xfHtBMtlYzsHIlBQLYx8YGvDM5ov7gj6IWL3J5D3cQJLp5BlYsMncMyW6C3BKsUiiGrY 0eN10kr4kMwcnsJ+EjzY+oR88ezNFEdtwcLU0KOGFIouQR1a9/3M56UOqCWlWeFlT2Rb Xe2xXPYi2QBnFLj5WkB/37lorXYhAuwHf9pFr2375AfOWZ0NGVAam9y/NI+eYKuoGrMe Ctlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720168493; x=1720773293; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+p1AzrmfZodSzccwf3+VZp/d6EqLietfSstUyXtOAno=; b=OJlo/ZLvcpqLYxNGzYwdMfQZ3TBs9nS/sUR7f6YCkjifiGWEckU8CaIKUwqXCTDUuv cXiLGjXhvi9nT4awtDp/m8wGtp+7nQEQRXv1vb36VoMJeOquSpSoHi/G13FYRGsmh2Xi HzrPlt7Rd5DGq04eOsIDb6TK6eAqeVKni+6jJFpm1hopP0RFFSIgUFvYxogNoyPSOYV6 3g7w5xRwIzFo8bpbCOdUoYUf7tPUOIXxtzdwToUlZz+HIjYwcoPoY6Go/x8d32TXUatN xkaE42/CBeJQ+Vuro9uhHvEr2KndK9DiP8/xt8EZrNR4peD3os0dCtHsa0ou4zJ9qPka stMQ== X-Gm-Message-State: AOJu0YzWkZjBeOub7bFlckiEtmUMlv/xfJLpU2Mm7BVUilubzFtPeczi WmS6M0GkpE/6I59zEIeFiwx92NAbHXQCqHKGZu9VcGAtUlbrfl6/VR+/vw== X-Google-Smtp-Source: AGHT+IFms1auzpgofUvVfpuunY0dcQX97iB8qk+qvzMPmXaSILZ2u55OxHNpKns6eJZYutZJ6bV69w== X-Received: by 2002:a19:ee07:0:b0:52e:8475:7c29 with SMTP id 2adb3069b0e04-52ea063cedamr2661859e87.40.1720168492754; Fri, 05 Jul 2024 01:34:52 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36789a02631sm8631138f8f.1.2024.07.05.01.34.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jul 2024 01:34:52 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org, ubizjak@gmail.com Subject: [PATCH] x86, Darwin: Fix bootstrap for 32b multilibs/hosts. Date: Fri, 5 Jul 2024 09:34:51 +0100 Message-Id: <20240705083451.87687-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This is Darwin-local, and I would like to apply it today to restore bootstrap before my weekend test-runs, but would welcome any comments or suggestions. thanks Iain --- 8< --- r15-1735-ge62ea4fb8ffcab06ddd contained changes that altered the codegen for 32b Darwin (whether hosted on 64b or as 32b host) such that the per function picbase load is called multiple times in some cases. Darwin's back end is not expecting this (and indeed some of the handling depends on a single instance). The fixes the issue by marking those instructions as not copyable (as suggested by Andrew Pinski). The change is Darwin-specific. gcc/ChangeLog: * config/i386/i386.cc (ix86_cannot_copy_insn_p): New. (TARGET_CANNOT_COPY_INSN_P): New. Signed-off-by: Iain Sandoe --- gcc/config/i386/i386.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 99def8d4a77..f75250f79de 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -27025,6 +27025,29 @@ ix86_libm_function_max_error (unsigned cfn, machine_mode mode, #undef TARGET_LIBM_FUNCTION_MAX_ERROR #define TARGET_LIBM_FUNCTION_MAX_ERROR ix86_libm_function_max_error +#if TARGET_MACHO +static bool +ix86_cannot_copy_insn_p (rtx_insn *insn) +{ + if (TARGET_64BIT) + return false; + + rtx set = single_set (insn); + if (set) + { + rtx src = SET_SRC (set); + if (GET_CODE (src) == UNSPEC + && XINT (src, 1) == UNSPEC_SET_GOT) + return true; + } + return false; +} + +#undef TARGET_CANNOT_COPY_INSN_P +#define TARGET_CANNOT_COPY_INSN_P ix86_cannot_copy_insn_p + +#endif + #if CHECKING_P #undef TARGET_RUN_TARGET_SELFTESTS #define TARGET_RUN_TARGET_SELFTESTS selftest::ix86_run_selftests