From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 4749B3858C62 for ; Sun, 31 Jul 2022 19:17:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4749B3858C62 Received: by mail-wm1-x333.google.com with SMTP id r83-20020a1c4456000000b003a3a22178beso2971786wma.3 for ; Sun, 31 Jul 2022 12:17:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc; bh=3LNv1WY26ZKzAGNt03AF84h8smWr/yVyBPrTDnbdkxo=; b=OO0IaQ4zb9LR9vyVaiTgWFIObBH16YuuVdVduiXYebJAMb3aeJDlwz+Nb0JWpn22xn bbDyj26TTzRN33CbVdQvaqbUrtM0i/Q8jVM6YFV2uhU9jSmK3VOXLhkjNNckLlG0zilq JsBdzLyVe6GdtUxW01UyV6itWHnQjH8HhXO+Cdfpadqy2jUip6wcgnFmELIuzS3v9W+l mcHJAUKcoQwnZxGU4OXbSqr4FnBFKsX90h6aq9y6surbAvvgXXvJonWfsz08cUV0iUqK QuaMOoqM2/Poxejy0NVos4cu5StVgVdvr/5CoISb/Zza4OhZga2wuCdZDhNEFNGZdSsw 2qgA== X-Gm-Message-State: AJIora+ETM0OPzeGEHzYlCxUU1aKMzqB/EhE2nyIiy8lq5dqMKR5EiY+ ghvonIM3fYqhqf41muPpRYY= X-Google-Smtp-Source: AGRyM1tcT9EEd9mp0WJFP4CJxgc97mGTcJ16RPCoVf8Ee69BVpXbCTYVEYnM3mrRG5cD9Q4WfHDYNw== X-Received: by 2002:a05:600c:892:b0:3a2:fb4c:2381 with SMTP id l18-20020a05600c089200b003a2fb4c2381mr9457693wmp.89.1659295058033; Sun, 31 Jul 2022 12:17:38 -0700 (PDT) Received: from [192.168.1.95] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id h6-20020a05600c350600b003a38606385esm17083634wmq.3.2022.07.31.12.17.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Jul 2022 12:17:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] tree-optimization/105679 - disable backward threading of unlikely entry From: Iain Sandoe In-Reply-To: <20220729085417.4B50F13A1B@imap2.suse-dmz.suse.de> Date: Sun, 31 Jul 2022 20:17:36 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220729085417.4B50F13A1B@imap2.suse-dmz.suse.de> To: Richard Biener X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2022 19:17:41 -0000 Hi Richi, > On 29 Jul 2022, at 09:54, Richard Biener via Gcc-patches = wrote: >=20 > The following makes the backward threader reject threads whose entry > edge is probably never executed according to the profile. That in > particular, for the testcase, avoids threading the irq =3D=3D 1 check > on the path where irq > 31, thereby avoiding spurious -Warray-bounds > diagnostics This breaks bootstrap on i686-darwin{9,17} with what looks like a valid = warning (werrors on stage2) cc1plus =E2=80=A6 -O2 -Wall =E2=80=A6 is enough to. I can repeat it on a cross from x86_64-darwin19, so I can probably = reduce the .ii (it=E2=80=99s like 2M5 raw) and file a PR if you like - = depends if the solution might be obvious to you =E2=80=A6 thanks Iain -------- In file included from /src-local/gcc-master/gcc/hash-table.h:248, from /src-local/gcc-master/gcc/coretypes.h:486, from = /src-local/gcc-master/gcc/tree-ssa-threadbackward.cc:22: In member function =E2=80=98T& vec::operator[](unsigned = int) [with T =3D basic_block_def*; A =3D va_heap]=E2=80=99, inlined from =E2=80=98const T& vec::operator[](unsigned int) = const [with T =3D basic_block_def*]=E2=80=99 at = /src-local/gcc-master/gcc/vec.h:1486:20, inlined from =E2=80=98bool = back_threader_profitability::profitable_path_p(const = vec&, tree, edge, bool*)=E2=80=99 at = /src-local/gcc-master/gcc/tree-ssa-threadbackward.cc:781:37: /src-local/gcc-master/gcc/vec.h:890:19: warning: array subscript = 4294967294 is above array bounds of =E2=80=98basic_block_def* [1]=E2=80=99= [-Warray-bounds] 890 | return m_vecdata[ix]; | ~~~~~~~~~^ /src-local/gcc-master/gcc/vec.h: In member function =E2=80=98bool = back_threader_profitability::profitable_path_p(const = vec&, tree, edge, bool*)=E2=80=99: /src-local/gcc-master/gcc/vec.h:635:5: note: while referencing = =E2=80=98vec::m_vecdata=E2=80=99 635 | T m_vecdata[1]; | ^~~~~~~~~ =3D=3D=3D=3D=3D=