From patchwork Wed Jan 17 15:40:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 188879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:414:b0:176:5f3:c5eb with SMTP id 20csp756233rwd; Wed, 17 Jan 2024 07:41:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5w4pgN5LTeQuvSwgOS4lG4qAtTutYUIQi++Ux+7LS+jnFd8ZC2Jo4lWbTBlcJnt7x442e X-Received: by 2002:a05:620a:6007:b0:783:5194:63fe with SMTP id dw7-20020a05620a600700b00783519463femr8843347qkb.140.1705506106309; Wed, 17 Jan 2024 07:41:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705506106; cv=pass; d=google.com; s=arc-20160816; b=HvyuLqb+ar7szFlk6I1B3nwGvoJJbSCxM/HQ2LO0+W2u55vjS5WNMi2SAwPx0fTA/4 +Of/4lNARYTpnAcXdxDHkIJx0S45f/dRIFI/rgPRt4YTKR2iPzfrpYXfUFnZorTtI4Z9 MIlD1iufpKYmkB2ujrIHs8QeQjfMAVLh51PdnyqUWHNn7nQf3UAqeGDCy0rNRkQCTINi s02+46Kzqw2rlgyN2tw+CnVTSBMr4UZ5irVdtURESQTQfAFXb+l/f5BG5QL0DYylYziS pnSiKGzHDpZG13nNXmp4aDdLVKcRheyE00m3QV58HYABTR1HcnN0/NsAK1HKCcjcqQnZ 17/Q== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=yddlPkH+2/A3rq/do+6VuQZEjYToPC0FzTppC+2wNAQ=; fh=HH8gx3a6ZAVIe7j/cTWZkIyw2tOHAq88eglNDxBWMWk=; b=Hivj/xLN5YGIk/Vw0wT/u3u/L/IxE9fptJ+SUJZXWAjNGhtwg1N80ovSMWx3fmonqg yNhTGoOtRfrmxNFGU633fHnCywAvbSOVGkupyUlgv4hFJBDwMYj7i8KlndLXVCYRN0Jb M/uOkZEsErC6zHqqJDOMtEs0TA1Lm5VbhmAGRAiH5bePPMTpxQm4vMuYV2omR9IvRXn6 WNjLFRoaWtinZQ7smIEJI2tyNCMF9r9PDQdIpCxinG/r/3J7gh5fhWDRTnJA9OYVbLKM JieiPIBhIr9BQfcHENqceDR4vQQe1m939M9iGin3XRbYM3XGcdKbGoe2DmMvroZG/1Ed Svjw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/Hh8SGA"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id du32-20020a05620a47e000b0077f10ed7a98si11183340qkb.489.2024.01.17.07.41.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 07:41:46 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/Hh8SGA"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE4E13858D33 for ; Wed, 17 Jan 2024 15:41:45 +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 7A89F3858D33 for ; Wed, 17 Jan 2024 15:41:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A89F3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7A89F3858D33 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=1705506067; cv=none; b=F21o32/cMnAgvRKJP9EgYgpwlfxdD+FrkxdInL9tztQmyomyt47UndwXQmvO0M8WhPENYuLshEnf7sx53xXrvFTpZzrD/uYjTi4Tio1hNeOnNCbvB5Elrk/NSf98o9YD0ZjKbk/f4Ntqb7pskkjromUBkunEMtj9B2vyHW/FhLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705506067; c=relaxed/simple; bh=YmG3DbmCmxeVtjvnlUyktL9hGHq4GEISLUJoDE7Q0o4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=P2uvp0QloKmk2jTunFhjfRvvgO+3E2J3DaLud4yGWdKP1M7u4F+xmkfYHAd19w68ORl8eTHRTv8UyFqbQAe6AQWWeniocasY7eYeXFVxLZ4oeLIOmWqaNkp7xWppPgMyKU1jUSP3GGCVxHkfrqYkcgJjFoNQgtVD4rFnYls5HC8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50e4e36c09cso2421258e87.1 for ; Wed, 17 Jan 2024 07:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705506062; x=1706110862; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yddlPkH+2/A3rq/do+6VuQZEjYToPC0FzTppC+2wNAQ=; b=F/Hh8SGAJtmojswr0WA0ZwtQXVcOR6k4lYZygkEoNd67PQGXlUDyGGmLCS/tidG9MQ remst6CvKKI0zrXo22A2mzrZc4TspLZk4UYHuNR9Iji7pWMQjefIY3tUEICT7WXk275c qXujuJa/NS1CNi8Lvdqu2hN/QM/j0s0IT3jFAOwWXaOyQFQDmKozb1KW4QjNNdFxKxNp tvBco9HelzO+2KRrABhQkiTeGoEkL8Argd9xB8rOQxD0+Iy7zPXYtQCQyMrBIVzXS6W7 Y0AEo5VM17m+NBtwkirC3cpnJpUEMw3EOCVY7jIyyywwhichIb5LWwQy5U6AjQL8TW0l YOZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705506062; x=1706110862; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yddlPkH+2/A3rq/do+6VuQZEjYToPC0FzTppC+2wNAQ=; b=pc8w7IhxSAAp18HO+8csXcCgjaRAq+ugSPNYiPmg6Iqp0vARQHbnVJCsk9mO+FI4I5 QlvMiFhfNoxoijW1/ANfzlI8uYjg2Tu9/z2KW9RR28e7bRE2HIof+yPvvcjuOQJQGpAb pdeUgKELrNfObPrAvOYW1X6Q9IniRf6au59n/Df9fdoMIqNHfOigiBVv33csO3OBpPeZ w01Iz7mvEtE/wgmtNT2/kO9+C9uyjuIW2hWnfKq5n1vUnEsqMqlw86XQGYeCSxbGVyHX gY2+HyAA/aQ3JmrTXcte/fA7+3tIo0MTTpyk5mGc7uTLtktxNIjRN4AYWcUV9DNY6GVl Qi7A== X-Gm-Message-State: AOJu0YweanSRbvPHkv9yvn+nYdICwI5B/eHemxopCa+BqUo6qIQ+EM0z RZQIjgLlAA5Z9aI4SGrHbG2XC/bkhV/38RDp4E9GvEB2JA== X-Received: by 2002:a2e:4a09:0:b0:2cd:1ca5:282c with SMTP id x9-20020a2e4a09000000b002cd1ca5282cmr1419181lja.5.1705506062143; Wed, 17 Jan 2024 07:41:02 -0800 (PST) Received: from localhost.localdomain (static.225.72.216.95.clients.your-server.de. [95.216.72.225]) by smtp.gmail.com with ESMTPSA id b11-20020a2e848b000000b002cdd330dc6fsm664370ljh.140.2024.01.17.07.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 07:41:00 -0800 (PST) From: Maxim Kuvyrkov To: gcc-patches@gcc.gnu.org Cc: Maxim Kuvyrkov , Richard Guenther , Vladimir Makarov , Jeff Law Subject: [PATCH v1] Fix compare-debug bootstrap failure Date: Wed, 17 Jan 2024 15:40:20 +0000 Message-Id: <20240117154020.1568974-1-maxim.kuvyrkov@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: 1788352770940746429 X-GMAIL-MSGID: 1788352770940746429 ... caused by scheduler fix for PR96388 and PR111554. This patch adjusts decision sched-deps.cc:find_inc() to use length of dependency lists sans any DEBUG_INSN instructions. gcc/ChangeLog: * haifa-sched.cc (dep_list_size): Make global. * sched-deps.cc (find_inc): Use instead of sd_lists_size(). * sched-int.h (dep_list_size): Declare. --- gcc/haifa-sched.cc | 8 ++++++-- gcc/sched-deps.cc | 6 +++--- gcc/sched-int.h | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/haifa-sched.cc b/gcc/haifa-sched.cc index 49ee589aed7..1bc610f9a5f 100644 --- a/gcc/haifa-sched.cc +++ b/gcc/haifa-sched.cc @@ -1560,8 +1560,7 @@ contributes_to_priority_p (dep_t dep) } /* Compute the number of nondebug deps in list LIST for INSN. */ - -static int +int dep_list_size (rtx_insn *insn, sd_list_types_def list) { sd_iterator_def sd_it; @@ -1571,6 +1570,11 @@ dep_list_size (rtx_insn *insn, sd_list_types_def list) if (!MAY_HAVE_DEBUG_INSNS) return sd_lists_size (insn, list); + /* TODO: We should split normal and debug insns into separate SD_LIST_* + sub-lists, and then we'll be able to use something like + sd_lists_size(insn, list & SD_LIST_NON_DEBUG) + instead of walking dependencies below. */ + FOR_EACH_DEP (insn, list, sd_it, dep) { if (DEBUG_INSN_P (DEP_CON (dep))) diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc index 0615007c560..5034e664e5e 100644 --- a/gcc/sched-deps.cc +++ b/gcc/sched-deps.cc @@ -4791,7 +4791,7 @@ find_inc (struct mem_inc_info *mii, bool backwards) sd_iterator_def sd_it; dep_t dep; sd_list_types_def mem_deps = backwards ? SD_LIST_HARD_BACK : SD_LIST_FORW; - int n_mem_deps = sd_lists_size (mii->mem_insn, mem_deps); + int n_mem_deps = dep_list_size (mii->mem_insn, mem_deps); sd_it = sd_iterator_start (mii->mem_insn, mem_deps); while (sd_iterator_cond (&sd_it, &dep)) @@ -4808,12 +4808,12 @@ find_inc (struct mem_inc_info *mii, bool backwards) if (backwards) { inc_cand = pro; - n_inc_deps = sd_lists_size (inc_cand, SD_LIST_BACK); + n_inc_deps = dep_list_size (inc_cand, SD_LIST_BACK); } else { inc_cand = con; - n_inc_deps = sd_lists_size (inc_cand, SD_LIST_FORW); + n_inc_deps = dep_list_size (inc_cand, SD_LIST_FORW); } /* In the FOR_EACH_DEP loop below we will create additional n_inc_deps diff --git a/gcc/sched-int.h b/gcc/sched-int.h index ab784fe0d17..4df092013e9 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -1677,6 +1677,8 @@ extern void sd_copy_back_deps (rtx_insn *, rtx_insn *, bool); extern void sd_delete_dep (sd_iterator_def); extern void sd_debug_lists (rtx, sd_list_types_def); +extern int dep_list_size (rtx_insn *, sd_list_types_def); + /* Macros and declarations for scheduling fusion. */ #define FUSION_MAX_PRIORITY (INT_MAX) extern bool sched_fusion;