From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id CFDFE386F820 for ; Mon, 28 Sep 2020 18:36:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CFDFE386F820 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=botcazou@adacore.com Received: by mail-wr1-x433.google.com with SMTP id k15so2425291wrn.10 for ; Mon, 28 Sep 2020 11:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=uSNajbrwdOXRt4o6rlOQNK/Jf413jCEl7wMPG3QfgYo=; b=c+Hs69aJYsqNH9Ad0Texxl8XEcRmnVQPTylNf4K3ZinAHOWivNbkwZ520vR/+9mCM9 RUx0uV0yzf7E9otsWN6/QgPJtgeiKM63TyuGLDpO6+TJ+1mbpaGzsld3SEpLCp+3uSgm DiiPbQPGNIr1NpuCMr4H9wzenLyuAJy/lc/g7AAP1nXmGVJnvuHTiKNaWWNOsS45vWOM leTwvKcAplXNMEqZ0joluxLgK0kONVt/W0j1MRFErI/KRtTOzu0g9tSwwNOJA1PMYc3H aWh4xejWdQ270iC4Xfwnefcxarm8GACZegX2OWGvrPR3+hXN0A8pt5bpG+FvEU9glCzT VNsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=uSNajbrwdOXRt4o6rlOQNK/Jf413jCEl7wMPG3QfgYo=; b=JyBxG0CYvw2A3yuK6DMoAULn76LQCqA+yqAf4ZIglZU0lcOkEbVrGLwWfr+pCiKLyK /X8ogiBfyxCoAlaoHw64JZ7NnuruitALQmLPkrT1WVFnv+rbEnIjdPjNb6mEqUbohJdn WvvuhzZCrSzX5FHpsYVHkiv0NUj/bMLW6Tsx8Fp2KqlPvBVUSmt8Ihwke8fDXPHo/rsW P2HG0ofkm/AE2nMWEnap3VRzpnM3FZQOLlH/7dS78hnWAOEYYVHaohdBKDVN/1Cc8szI 6X/xaLz4kIkabPDI8//NMMdAlq4Mu1l3FLXKFyjzpE0Om4DtqEhmFJcz0APFY14ABO3d qUNw== X-Gm-Message-State: AOAM533qQNvD90X3shyxVO96A3EtwbiSj6OoFzJJSt56mmB2yI/shjrX UOC5Nuk/ysD8UWNGt+qPrjrl0ire/V6c1pvo X-Google-Smtp-Source: ABdhPJwlgwrbtHGShMz+xszYcxHS+U7D2wuH03HUVKjQvL5q1Cn6oSH9oWuHYghJRIaJqeJ9osKm1w== X-Received: by 2002:a5d:5261:: with SMTP id l1mr3049577wrc.193.1601318218266; Mon, 28 Sep 2020 11:36:58 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:41b:9230:7f82:53f4:769e:54b6]) by smtp.gmail.com with ESMTPSA id l18sm2572405wrp.84.2020.09.28.11.36.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Sep 2020 11:36:57 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Do not use doloop pattern with pragma Unroll Date: Mon, 28 Sep 2020 20:36:52 +0200 Message-ID: <1891027.TnL9IUE11E@fomalhaut> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart6370385.8rHZESirjr" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , X-List-Received-Date: Mon, 28 Sep 2020 18:37:01 -0000 This is a multi-part message in MIME format. --nextPart6370385.8rHZESirjr Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, this fixes the following Ada failure on 64-bit PowerPC: -FAIL: gnat.dg/unroll4.adb scan-rtl-dump-times loop2_unroll "optimized: loop unrolled 7 times" 2 The IVOPTS pass detects a doloop pattern and consequently discombobulates the loop sufficiently as to make it hard for the RTL unrolling pass to compute the best number of iterations. Tested on PowerPC64/Linux and x86-64/Linux, OK for the mainline? 2020-09-28 Eric Botcazou * tree-ssa-loop-ivopts.c (analyze_and_mark_doloop_use): Bail out if the loop is subject to a pragma Unroll with no specific count. -- Eric Botcazou --nextPart6370385.8rHZESirjr Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="p.diff" diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 5acf044161c..da04dd5ba0a 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -7947,6 +7947,9 @@ analyze_and_mark_doloop_use (struct ivopts_data *data) if (!flag_branch_on_count_reg) return; + if (data->current_loop->unroll == USHRT_MAX) + return; + if (!generic_predict_doloop_p (data)) return; --nextPart6370385.8rHZESirjr--