From patchwork Mon Oct 16 09:18:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 153278 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3334455vqb; Mon, 16 Oct 2023 02:19:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFW+hLERkYkwWTVuK5cY6/X4V1poXc6fgPBF5w81fQ7+pF8GpjgyLyHtN+GT71cDUrzwcTq X-Received: by 2002:ac8:5dcd:0:b0:418:1727:fef8 with SMTP id e13-20020ac85dcd000000b004181727fef8mr43608824qtx.35.1697447972790; Mon, 16 Oct 2023 02:19:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697447972; cv=pass; d=google.com; s=arc-20160816; b=1BcTug3hRQWthaMRqrZwnMkUSA8Gv4FZWR6KsiyO2Ltru84pc8a1gnay5ETDZxVYGe ZTPlxmk4uQ39c5JenAs3d7iv/XSclzwSKp+AiGVBP3e0q786nbq6vcVLay+KiQAu42+7 pbjQNywnwafF1mipNpCI5E1KplABcL+itOmdkDmei/ifZn4uMvjCzXcMrrveufV/MDDr 7Cy1wz/GoaCseLS+e9VPo5FxE/WiDuvcAzQ+fXh1Tz2YQw3mrUG6sM9FQ8s8HTl+fxYI HY1dXXSH3mIHsacN+HXjmIoz1TgTKxCplH2rdripzIIgsYkycUBLRIWrsR1g1AlWc2Oi VViw== ARC-Message-Signature: i=2; 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:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:arc-filter:dmarc-filter:delivered-to; bh=3qqLTAHW2ywYOqbpFNDgaxBykE14kPUIQyNcKojpRFw=; fh=C1ZaxBnye5CQ+dVWHVur8KU4Nz8sdK/4fcYMx7sglMc=; b=xfG7WNggD8CAVLz9RJiCteT3kfSgCRuQcHPRiABgyHTLhKGhBB5DCjheIbhKrCqsP1 /REoZYk4wBRGGSl6w17s5Bp+rhkGlilE2AmZ/FPD4a1TdShjoYfPYsmwt35Jvh/+6ux8 yzZtM61uXZ1VJVpuJUrbjiwRBSiKuLYmOsfPl+WAtjLnzbCQVoDdRhAy7nYQvoHUtq4n lkQoCj5SLeBZ2qq3jA6AETpuAnzyzcoMufhtib9tQC78CRTnKDqJZLG2GEAuaz7Nv0A7 dZ3Yg0M9Qg5gN2u3dMVRznwQXPBkaILjVG79vwusiNy2T/A2VcgT5WIBEMA9JfqiAm+t yHHQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q14-20020a05622a04ce00b00419a4b7aa58si5103229qtx.42.2023.10.16.02.19.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:19:32 -0700 (PDT) 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; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC147385771C for ; Mon, 16 Oct 2023 09:19:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 148543858296 for ; Mon, 16 Oct 2023 09:18:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 148543858296 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 148543858296 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697447940; cv=none; b=W6lS9xGTebYTuAo/i1rBFgji4caKpoW3Fxrxqxil+8syU6kspNDol9v68/WI0S7L47nxbreYKGa8XFv9+h0OXnSuHhV8Rk0t+DPllGIx6NooJvurZTbiS6aQcx5hDwzeMGz6qMNjtNDMBaklmO08RMFJAME6EbIrFkVF7f9jwbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697447940; c=relaxed/simple; bh=ZzOOdNy7mboKslv+YOo46m4K1UZA+7QEfqHosCtNJFA=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=f4LJuT+mS9GZlGuigAA9tlaKBO+ybHrm7l80Ph0E69xiODxnZ3NRxOj7NWedasSytEkSkEO4/9TgxaG7TtrWmqDDa3L/Gb6Mn7oOLBmoF5Y/lQ5JqN/6HtCesiZXmMBwFO64Yi10sqseoxsDUs7FO91G16/vwMEFtOv/herAmeo= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: jDasNCRFRnqBjoRtfuT5CQ== X-CSE-MsgGUID: OJMOGU5lR1CIOgEbw4m9Kw== X-IronPort-AV: E=Sophos;i="6.03,229,1694764800"; d="diff'?scan'208";a="22268572" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 16 Oct 2023 01:18:51 -0800 IronPort-SDR: H1LTrCvY+oaLn4xK4Z90pjBmZhIm0ySSVqaiR+vf0JR+0i1Vff8zS8yfe96jSvvAqnGIui0ptw psZ2P96xDTJ30gmlRWvzLB6GKewt9bVxBH6U/eltLOXnt6i02ZnXdQNRxVdB+UXvf6rssHzXS9 z8DBECSBcc6SSO857Zf8ru/3115Vj2XRVpdrHZKCOJd0GXVnV3C5Wkrg2sKZG69p30pacYB4Ag +ANotynY0pZ1L1ZbmgE9Gi3rL/JPD9LqQgigyqDv5RFZlGq6CWYUEn1obYlTE5XhNRmVe3eKfm 7Q8= Message-ID: <928b02fd-2662-4a4d-9c55-ab538464b7fb@codesourcery.com> Date: Mon, 16 Oct 2023 11:18:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches , Tom de Vries , Thomas Schwinge From: Tobias Burnus Subject: [Patch] nvptx: Use fatal_error when -march= is missing not an assert [PR111093] X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779903205593178635 X-GMAIL-MSGID: 1779903205593178635 While mkoffload ensures that there is always a -march=, nvptx's cc1 can also be run directly. In my case, I wanted to know which target-specific #define are available; hence, I did run: accel/nvptx-none/cc1 -E -dM < /dev/null which gave an ICE. After some debugging, the reasons was clear (missing -march=) but somehow a (fatal) error would have been nicer than an ICE + debugging. OK for mainline? Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 nvptx: Use fatal_error when -march= is missing not an assert [PR111093] gcc/ChangeLog: PR target/111093 * config/nvptx/nvptx.cc (nvptx_option_override): Issue fatal error instead of an assert ICE when no -march= has been specified. diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index edef39fb5e1..634c31673be 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -335,8 +335,9 @@ nvptx_option_override (void) init_machine_status = nvptx_init_machine_status; /* Via nvptx 'OPTION_DEFAULT_SPECS', '-misa' always appears on the command - line. */ - gcc_checking_assert (OPTION_SET_P (ptx_isa_option)); + line; but handle the case that the compiler is not run via the driver. */ + if (!OPTION_SET_P (ptx_isa_option)) + fatal_error (UNKNOWN_LOCATION, "%<-march=%> must be specified"); handle_ptx_version_option ();