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 CD7F03858CDA for ; Mon, 1 Aug 2022 08:33:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CD7F03858CDA Received: by mail-wm1-x333.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso7051485wma.2 for ; Mon, 01 Aug 2022 01:33:06 -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=q3mar1HAqzC2vrWLLqqGBrA1Ylkcf7i/7W0DfV+FsI0=; b=ATTbMwq8u1MdMZc6p4EZPxvKuWrMDhtDdPJeK8P31//4/dpTQSMYvdfmmn+hGHMFyG W6sGlGFlx6D6DRstDA5TWotqLVMOB+Wo8+WhohoRz9LEDqFta16yHMJ2QNGAq9wFwkJV 7YmMKGHvcHjFr7kkhbQUpN0YrZQf5xHmX3fNGLC3nVBpYLXOejhVLwWmZgEJKJgQJQFf xdy2IA+yKXRcwudcJTRPoHkY7v0KYT7Dxx/3+O0Zij1K6VhsyZoTzGt0EVTDLQk5XncM /6qk/+4qsFFI1AGAswJUwcrZC/dhAACtweOSbSz6uxGnrahoJ7rkMM4N7J70n73kr3Al IlyQ== X-Gm-Message-State: AJIora/kQEzB/r64ALvRYScHYAN87mFLkdTm9u2HXa2ljE/brFocigAL tQEBMnFbZWnkGnoTK/jz4Os= X-Google-Smtp-Source: AGRyM1v8p2p2IscVgzTZ20FZA+JNiIyQ4m+g1Th4Z4FxOFaaAqcfXNhx8Byima9hsLSa4IgR4i2oDA== X-Received: by 2002:a05:600c:683:b0:3a2:fe34:3e1a with SMTP id a3-20020a05600c068300b003a2fe343e1amr10600559wmn.192.1659342785341; Mon, 01 Aug 2022 01:33:05 -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 s10-20020a5d424a000000b0021e6effef8bsm10705277wrr.50.2022.08.01.01.33.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2022 01:33:05 -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: Date: Mon, 1 Aug 2022 09:33:04 +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, KAM_SHORT, 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: Mon, 01 Aug 2022 08:33:11 -0000 > On 1 Aug 2022, at 09:21, Richard Biener via Gcc-patches = wrote: >=20 > On Sun, 31 Jul 2022, Iain Sandoe wrote: >=20 >> Hi Richi, >>=20 >>> 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 >>=20 >> This breaks bootstrap on i686-darwin{9,17} with what looks like a = valid warning (werrors on stage2) >>=20 >> cc1plus =E2=80=A6 -O2 -Wall =E2=80=A6 is enough to. >>=20 >> 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 >=20 > Can you open a bugreport and attach full preprocessed source at start? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106496 > Note at the start of the function we have >=20 > if (m_path.length () <=3D 1) > return false; >=20 > so >=20 > edge entry =3D find_edge (m_path[m_path.length () - 1], > m_path[m_path.length () - 2]); >=20 > is known to not access m_path out-of-bounds ... yes, I saw that .. so I guess somehow that information is getting = dropped. thanks Iain >=20 > Thanks, > Richard. >=20 >>=20 >> thanks >> Iain >>=20 >> -------- >>=20 >> 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]; >> | ^~~~~~~~~ >>=20 >> =3D=3D=3D=3D=3D >=20 > --=20 > Richard Biener > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 = Nuernberg, > Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien = Moerman; > HRB 36809 (AG Nuernberg)