From patchwork Thu Nov 16 22:28:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoni Boucher X-Patchwork-Id: 165947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp155472vqn; Thu, 16 Nov 2023 14:28:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwaSbs4DucQ64odapT7BbVQdZSWTnC2T/O3VfFShjrYstc8CGakeRezoSLFMIfCON6JRC3 X-Received: by 2002:a81:a086:0:b0:5a8:1058:5d97 with SMTP id x128-20020a81a086000000b005a810585d97mr18233952ywg.45.1700173718597; Thu, 16 Nov 2023 14:28:38 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1700173718; cv=pass; d=google.com; s=arc-20160816; b=DCrWo2fStyMbC+ZPHF9wCImVxkT22+Xatj+Y6Jh7J+KZlHOYIJjmvbQygbTE3Az3fX bI5pD3It+6XQFIT5mTWid+2bE+JGi1JLxazw7CC7QlAdGWRG7sIjSLYCBYOmymtW3zs7 6jacNjvCkxEMDt0L6hpvyl1s9bzgSQpQISU68Lzu0RKbxIjVCsOCmslRkGGOTWcDxeCO StfSNKqmtWSwb0XLbb3wA5NqOxqUKZTzP8h9bak/5Yxb+S/owC/1mQ+vmHSQp+tI0UY2 xACAi3T6xzKBFxyPEJYhuY0Bg9T/G9Q2+YmIPizR/h+b9KLQnx1QNTC/Hqc1G/gx2Vr0 JMEA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id:mime-version :user-agent:autocrypt:date:cc:to:from:subject:message-id :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=DTe4sD6sCDl+3ktt2mXfPJqw8MXRHqiJDNj9OTneXNY=; fh=JISpz+bBSU4NvpZkyVsds76plEm8twWz26DY1VOoDBc=; b=ck2RFhFo5WetSxnH3PRKJCLFLH/eCvySiuIv1pjYs1/OTMiale4blJ/DX/Zg4tHe5t z173d+wt9iBban9HfLOwM032Nwm8UMj4XzpGsFOUnWrmwXFG2C0DHFT2xbiOQarzrSzd 7N415PqcP7uGXHuwZJGeKIF94dCItpofKFrtQmIcJ+jb5iKdGbIdLmIMQKlW1V7nYqvl GUB0WlPpa3RkEg2LtxthUNO1MBvVq1IpRRmm4Fhg/JgHhS3zn8kIEFDv/LqSPDyEGEIP dq41kU5aqzZInmNMPHaKcjVnYBOMITjTeHiUtQC+6GWXT59sTHoccUxkz13pBWq+XUxC l+DA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2022 header.b="D4q7o/9j"; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pe2-20020a056214494200b00668e6f73a24si331017qvb.291.2023.11.16.14.28.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 14:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2022 header.b="D4q7o/9j"; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41F553858282 for ; Thu, 16 Nov 2023 22:28:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from sender3-pp-o97.zoho.com (sender3-pp-o97.zoho.com [136.143.184.97]) by sourceware.org (Postfix) with ESMTPS id 256543858408; Thu, 16 Nov 2023 22:28:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 256543858408 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=zoho.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zoho.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 256543858408 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=136.143.184.97 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700173694; cv=pass; b=EYaCXpIqLmtMOYzCUP9w8nbaJrz12Y/7cyyGhHDHdjvzhrVGv0nBWJNTc/GJ7qdCX6aF7h4wwcgbsAc9flbS4lneKKvHnh+VyYKZyJMmP9WAbdpKjT2U9euZQVcXinzeKgrENVWhrOIyVbahxhHpGs2qvUKXVNZq1dOLtnVELRg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700173694; c=relaxed/simple; bh=mktDgEBxD7X8oe7PeIyffGcoLxCp/5wf2Zzfzjv5XA4=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=sqUwVxQV9/MloqqqfftQKEoCbLecFFrcgrxGsipt9714OvLhgz0LuLttH/pTEBNgqjHw9GSe+Lwf2h5b6OzEeqP2v2SuCvlscxKTPCTKiD0G1yW3gpWuPvWtT9jd6VC61u9TWvH6zD+Flu62GCqM8z8QkGyl7v0GlkmkXHUdDyE= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1700173688; cv=none; d=zohomail.com; s=zohoarc; b=Xj709ekrrvjXyXKjXxvuPkiiid6b/1S5ynf3hhJ0vBn5r3j6A4z3e0hoC1YOnPcL0w96pbRnS0+03ZLSefLJ7Fcau7laTS/6ulO76Qqv01Spc6NaLW4aQgTjBubTbwhz042bSfSw0tJ/hShQE92mST/U5wLkp7In17ijMWiWqSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700173688; h=Content-Type:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=DTe4sD6sCDl+3ktt2mXfPJqw8MXRHqiJDNj9OTneXNY=; b=BS2xvNiUJJ6W6etCNxnBOrqZUA9U3dKgGPO4ZcylvSvGyqWRzW5NkD0jCuRUk8GvCHioOSnDQP9LFKpRWiNGySAPONp590orsuE1VYEVawhZQKcED3ZbpR8ldRf7q+1Uu80ccqutybnMG+kpkn87xL5GFk77lN5sBs4cne0rgvs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=bouanto@zoho.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1700173688; s=zm2022; d=zoho.com; i=bouanto@zoho.com; h=Message-ID:Subject:Subject:From:From:To:To:Cc:Cc:Date:Date:Content-Type:MIME-Version:Feedback-ID:Message-Id:Reply-To; bh=DTe4sD6sCDl+3ktt2mXfPJqw8MXRHqiJDNj9OTneXNY=; b=D4q7o/9jiUy53mm2W2vXLmpJXqnPlPvkrMBj+XBqDjTOJiNncPvJsH1wkWXmcD56 RfCF5ToZhGQiXJUIKhl7B90zXF2E7FWo3Kr4nOJ54cHzu789W8ibf1XjDJX19VOmKZg sBaNuKGCl8ftb0Un3EAlPjumpPsDG8s+f9CaoOCs= Received: from [192.168.1.172] (38.87.11.6 [38.87.11.6]) by mx.zohomail.com with SMTPS id 1700173686813133.44318956986842; Thu, 16 Nov 2023 14:28:06 -0800 (PST) Message-ID: <531885fa576a672454e6630549858842588c800e.camel@zoho.com> Subject: [PATCH] libgccjit: Fix ira cost segfault From: Antoni Boucher To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: David Malcolm Date: Thu, 16 Nov 2023 17:28:05 -0500 Autocrypt: addr=bouanto@zoho.com; prefer-encrypt=mutual; keydata=mQENBFOSMLQBCADO5aw6Ys8thMQUNzrwAnfJX2wbgWiz0pQ01DjYj22eeIpChkoZn6LWdt4dieq30u2rFi/yQzJ02foHwI2+aL9rU6xz/x4TwqyRJQGMOqklNc3R+pdXmH4WDQkQDWmLxvc07vu+zb8Tx5A6pMDh4J2ncCEhLEUcH39Yq/yg4eBnFwUX6N7kakvHrnScGNqhnSFCacoJeMJUAR+1G7VBSBd++jmnHLnx3mj7QkRZVECJUw2zqiv1yReCC6GU4SvqLjdqm5ZGeoWOqD/NHjBRoEeOVjzp6M/qOjjWRbkJVqmvgfcD8UytSSqqboR35YFT4L+rZt2ri3T12MJb3i5syCAXABEBAAG0IUFudG9uaSBCb3VjaGVyIDxib3VhbnRvQHpvaG8uY29tPokBVgQTAQgAQAIbIwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAFiEEOELC4Uw1Jeb66YE6RVeGAwR4zcEFAlz4QM4FCRLMEZoACgkQRVeGAwR4zcFBQQf/afttJrA/puADQZhrDfkgr0MFvq6iB+GCy1b8BkXimk1TOXTPt87YLehSeijNu3JkYhl5eRc87BNfU9J87KfI/KIy6hZxqlDXk16FhW9bw/7wYEA0hpb3MUn7xLElXDT0ZHaD+KTe8Oun7qfzgx5RlL6r/WODf3CkSpO085R/rfeBqDEx9mVlhDWgq6Az3CZoD+3CqiCKVqmDuHTWz4kwrd9AM5eVcLvvLKnZIdoIp+G5Ao6BvaGlZyfenN1iOSjLy2NXNt4MnUt0lUYEP5KSIIRhHQ8xkUbj7eWUmaahkxhNb3fH3sAPwGnRZrPpb4rgYzNmSk63wWMh9M2xk+rLb7kBDQRTkjC0AQgAumZzsAV/UFWI+dpzebQfma36kKYZZFuseant5sq/HWP553XQ/U6ttJiKyN5MpCqtxvCAoRplf42YhlHuFqgf73WJxoJ6Y+sdyqoBSwlR+ gzAneAmsa8gmmY0wawH0Z2leazjKuS7mJjVEQZg0ZGsiCVRGeRnDqFGzDEzDc9ngWKSoTq0fKzlGy1X85OrtmUrvEbhSo6HP+FoeunHkIqrxu3w3vDoFEXxVQlKI6V3I4nCz5n6DB8WR3L7nsiiTnOiGirPw1ngvWFLW86kkA4FJpayc8Xl3va3SLY+2y4yuROboX2DVI4AC/Qeug/mDiBicPxkP6YfUartQRMe6obkEQARAQABiQE8BBgBCAAmAhsMFiEEOELC4Uw1Jeb66YE6RVeGAwR4zcEFAlz4QRsFCRLMEecACgkQRVeGAwR4zcE56ggAgTgrJInBKC+7552Dpccuo6Clh3wZfjlNLv9/6r5lKEbaNzaTrfhPiAP4WgnluIUmj8amOFLFJpj+BAVNOXpZ4D2R3o9ch8z7fot+fW4Yw+PKIxH4I2xEys8ndoEB3aiQwHjKcGIhkIU7uyMJFQr2aWjdTY0gmXw0YZueHOSLgo7uX4XKxB8fEO/yto/Tff2YBAAq+AtNwt+Gh5YS9rZw7rwUTWMi84yVOlc+zRE79E9NJkvdTwX7IJYo64VzIRNfgHsn7QNdVzuM1XIFHl+Glk6cIlI8s6BO7nEoCn3hTF104fQTAO3fEs+XXZOKXo2lk8faowEoPq5r58StrV0nyg== User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-1.1.0/200.101.90 Feedback-ID: rr080112285e5ef6b1baa1d789f0202ef7000094b9eec96e770df3169ecfa26c5100c7c8cff8aab131ae3b84d1:zu0801122687c4e9c376cde3757c85f7ea0000ac1792a36f584057df23ceeaa761956268a55ff344888573:rf08011232da1076fc087c00a753c515f10000bbe420943af137c76bdab0c20755f32c6869919d122a612f1f7196367ab3b26e80f94ab9:ZohoMail X-ZohoMailClient: External X-Spam-Status: No, score=-11.7 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, 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 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782761357144261415 X-GMAIL-MSGID: 1782761357144261415 Hi. This patch fixes a segfault that happens when compiling librsvg (more specifically its dependency aho-corasick) with rustc_codegen_gcc (bug 112575). I was not able to create a reproducer for this bug: I'm assuming I might need to concat all the reproducers together in the same file in order to be able to reproduce the issue. I'm also not sure I put the cleanup in the correct location. Is there any finalizer function for target specific code? Thanks to fix this issue. From e0f4f51682266bc9f507afdb64908ed3695a2f5e Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Thu, 2 Nov 2023 17:18:35 -0400 Subject: [PATCH] libgccjit: Fix ira cost segfault gcc/ChangeLog: PR jit/112575 * config/i386/i386-options.cc (ix86_option_override_internal): Cleanup target_attribute_cache. --- gcc/config/i386/i386-options.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index df7d24352d1..f596c0fb53c 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -3070,6 +3070,12 @@ ix86_option_override_internal (bool main_args_p, = opts->x_flag_unsafe_math_optimizations; target_option_default_node = target_option_current_node = build_target_option_node (opts, opts_set); + /* TODO: check if this is the correct location. It should probably be in + some finalizer function, but I don't + know if there's one. */ + target_attribute_cache[0] = NULL; + target_attribute_cache[1] = NULL; + target_attribute_cache[2] = NULL; } if (opts->x_flag_cf_protection != CF_NONE) -- 2.42.1