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: 763298 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e5d:0:b0:337:62d3:c6d5 with SMTP id j29csp332500wrz; Wed, 17 Jan 2024 07:41:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHdKbo0NjlRLZyXkjJuVyDtNKMD4Ei3qW+MN1mExIZjDNm3Nwq5l33Ln0bpVvf3HhcNiHd X-Received: by 2002:ac8:5f46:0:b0:429:f1d6:ae21 with SMTP id y6-20020ac85f46000000b00429f1d6ae21mr5840914qta.86.1705506119740; Wed, 17 Jan 2024 07:41:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705506119; cv=pass; d=google.com; s=arc-20160816; b=zOnIk5xxcIqPhtgc0r/t7Lj2EpG2DTNYeEGfUuRkCPfe6QZ3TDjcO6tXfCW5exbaqk SjdoGwicINSDugw7a821l3raspzzPQ5ZX8eHCNuyz8Y//z2szcfa2IA4duwfNuOQDWIf /kflp+7g9LllV0BO3N5TNF2k/YTEW4X7HNFUk1mbkJUzwam0yrt2qGnwQteB6lmLAnsW WPriLLtvNgFo9OjGB3Uv4/smYaATXoyrIYbf/NqIVR5toyFaLXMbzxJuAmrLenMSlmFN MYz6Y653ckf1sDaXxOmeKvX3fjb+saCV5r2RHqplBDNRWLxgWs92eGTeRGjgXzKshkHM CnGA== 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=eTFCDnrkjENR0XGRzh1ntZyuzTWGToTl/EEOVDdykEh2sM0yF78IU7cWdcj2W44fOS txh1iy2De2iOQeCRnDzkvk6jL1V6eGh0erIvmArBG9oocLMBjZ0rtp826tTBAjC743u9 SxmVzIGkxVNIlEDx+UEdQvfO7Y0L+sQXUOraLpnrHThf2pKhDuTTv0Yxr6It2tOwuxmb jFjKalC45yibXV1Kfj/HTluEj2f4TzS0Uqlla9wLZCfqm5iBvgdo753ZcGcAxHm3RTZD Ujn8lVBA6FlMHB7a13W7F6CU3nkxEL2jM4dYBECy6GcLJLATOhtEF7avkBfoiwQGhc93 ImxA== 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+patch=linaro.org@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id c22-20020ac87dd6000000b0042a02c46912si3243032qte.474.2024.01.17.07.41.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 07:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@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+patch=linaro.org@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@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 630453858428 for ; Wed, 17 Jan 2024 15:41:59 +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+patch=linaro.org@gcc.gnu.org ... 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;