From patchwork Thu Dec 9 17:32:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abid Qadeer X-Patchwork-Id: 1565986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J91M01pQbz9sCD for ; Fri, 10 Dec 2021 04:32:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A864B385803D for ; Thu, 9 Dec 2021 17:32:24 +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 511183858C3A for ; Thu, 9 Dec 2021 17:32:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 511183858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: 9UaiPaJIaOlmZXBwL2xdS4aWlguhOEztzGgkYR9fhPDluj7PlO/84DaH5a14NQSRiQwEFonzp6 XdoUqptG3w1zSq/dNS/uolAKCmyXTIpy/qz2rRuyht/dtLSD+eC+aFgDG65+m07VJiLkSbfCvf WNXquukmKCU39Vn7J3UffijFZoDUzdCELBSUtimKWUX7tJVvaw6N7VO7FvOMIUIM3NYAPMkEYw zN/OXdHMWQ1dKkytFWyzlVkadQqbnzgKkVkIwtZQw1N/j8ZdHboOUCvxJpkMEEj9YZlgqRBrgO hQU0o6poY4HSpacj1pNdCkVT X-IronPort-AV: E=Sophos;i="5.88,193,1635235200"; d="scan'208";a="72016418" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 09 Dec 2021 09:32:12 -0800 IronPort-SDR: PS/CB1UuO5QGyCK7DUT26HHYbGhyKj1lKT2NJygGofllGvIk9Y3Zy3G3v/NPOYdc4wfqdgAh4E kNWtKopNXVPI1Kl0AC2PLFqhTSYY4YWukVDDTuuWI8oHbu73T+1EqGCVt27Wwoj44Qj0wGHpoL NnT/hvM4KRAeWizIO9k8HPyYdhSwvIbU9/uLgdXsGFsP8xAwH4IoKqHJoP/pD2Rp08PVa8rIm2 HhrMBK9hkz0z+1LYQs/vE1CdQ1Pz0FZj3bjuJD/rr7uMF29OGnvchck/BIYwV0UFhjtmlk1+5h 5G0= From: Hafiz Abid Qadeer To: Subject: [PATCH] Remove an invalid assert. [PR103619] Date: Thu, 9 Dec 2021 17:32:02 +0000 Message-ID: <20211209173202.1522247-1-abidh@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-12.7 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jakub@redhat.com, ams@codesourcery.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Commit 13b6c7639cf assumed that registers in a span will be in a certain order. But that assumption is not true at least for the big endian targets. Currently amdgcn is probably only target where CFA is split into multiple registers so build_span_loc is only gets called for it. However, the dwf_cfa_reg function where this ICE was seen can be called for any architecture from the comparison dwf_cfa_reg (src) == cur_cfa->reg in dwarf2out_frame_debug_expr. So dwf_cfa_reg should not assume certain order of registers. I was tempted to modify the assert to handle big-endian cases but that will still be error prone and may fail on some other targets. gcc/ChangeLog: PR debug/103619 * dwarf2cfi.c (dwf_cfa_reg): Remove gcc_assert. --- gcc/dwarf2cfi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 9dd1dfe71b7..55ae172eda2 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -1136,7 +1136,6 @@ dwf_cfa_reg (rtx reg) gcc_assert (GET_MODE_SIZE (GET_MODE (XVECEXP (span, 0, i))) .to_constant () == result.span_width); gcc_assert (REG_P (XVECEXP (span, 0, i))); - gcc_assert (dwf_regno (XVECEXP (span, 0, i)) == result.reg + i); } } }