From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 5363A3858C3A for ; Tue, 21 Sep 2021 06:17:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5363A3858C3A Received: by mail-ed1-x536.google.com with SMTP id dj4so14392499edb.5 for ; Mon, 20 Sep 2021 23:17:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BCfibCMAg3NHsQXohOdpja7sqGKxCUwTL9yK91IWkFU=; b=IgYOzyx1WiC7dghYyaoo83NWn2cAqwqY2WaK6Cn19A3wb2HdcBYaUjXC/aWPnpzstt /QxroGLqpuKX/aQooYHcSA0vPFTO13qVkr+UZ8NVHn+ObU75aDKozsbl91aebJus8qB1 sRdq++M4o9U32BJJhsgTrZuj5yDbEGepgs+sG8Htn9JRcC8BV76eD5pvGtwTC58gMK1J ILD+c4Lae5KFdjKLrMUByAZXKclUsAbnKWSNZinzA5AaSuUx2pB9cCLn5yMCw3/qjVjB vqJZZmcLolWV6sUtxC0SGAYCFsfg3cP1FP8I7raSM8WLLwKLyQZS8CRfP0J96itmdKzm Mqxw== X-Gm-Message-State: AOAM531vodZl9mHPuz2rI7bFGjwczdJQbyNih2cnfNl0G6ypX66Swd8W jxvHdBO5OlkR3OzV4DbBytXqLHdCZ/W6pzYloaukAwLP X-Google-Smtp-Source: ABdhPJwXiFhSDdWQPw2WqT9Gxsg4iVCw7wCqOfmqsMCCS9wtpqloFNvdTzOfHK6UC44AGs8bYiTZ7M7oVKHRfBkWX3I= X-Received: by 2002:a17:906:584:: with SMTP id 4mr32672450ejn.56.1632205025418; Mon, 20 Sep 2021 23:17:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 21 Sep 2021 08:16:54 +0200 Message-ID: Subject: Re: [PATCH] ipa-fnsummary: Remove inconsistent bp_pack_value To: "Kewen.Lin" Cc: GCC Patches , Jan Hubicka , =?UTF-8?Q?Martin_Li=C5=A1ka?= , Martin Jambor , Segher Boessenkool , Bill Schmidt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 21 Sep 2021 06:17:07 -0000 On Tue, Sep 21, 2021 at 4:09 AM Kewen.Lin wrote: > > Hi Richi, > > Thanks for the review! > > on 2021/9/17 =E4=B8=8B=E5=8D=886:04, Richard Biener wrote: > > On Fri, Sep 17, 2021 at 12:03 PM Richard Biener > > wrote: > >> > >> On Fri, Sep 17, 2021 at 11:43 AM Kewen.Lin wrote= : > >>> > >>> Hi, > >>> > >>> When changing target_info with bitfield, I happened to find this > >>> inconsistent streaming in and out. We have the streaming in: > >>> > >>> bp_pack_value (&bp, info->inlinable, 1); > >>> bp_pack_value (&bp, false, 1); > >>> bp_pack_value (&bp, info->fp_expressions, 1); > >>> > >>> while the streaming out: > >>> > >>> info->inlinable =3D bp_unpack_value (&bp, 1); > >>> info->fp_expressions =3D bp_unpack_value (&bp, 1) > >>> > >>> The cleanup of Cilk Plus support seemed to miss to remove the bit > >>> streaming out but change with streaming false. > >>> > >>> By hacking fp_expression_p to return true always, I can see it > >>> reads the wrong fp_expressions value (false) out in wpa dumping. > >>> > >>> Bootstrapped and regress-tested on powerpc64le-linux-gnu Power9. > >>> > >>> Is it ok for trunk? > >> > >> OK for trunk and all affected branches (note we need to bump the > >> LTO minor version there). The issue comes from the removal > >> of cilk+ in r8-4956 which removed the bp_unpack but replaced > >> the bp_pack ... > >> > >> It's a correctness issue as we'll read fp_expressions as always 'false= ' > > > > Btw, on branches we could also simply unpack a dummy bit to avoid > > changing the format. > > > > Committed in r12-3721. Thanks! > > As suggested, the patch for branches is listed below. > > Is ok for branches 9, 10 and 11 after some trunk burn in time? It's OK for branches without waiting, maybe you can do a LTO bootstrap on the branches for extra safety (just in case we're triggering some hidden issues due to the fix). Thanks, Richard. > BR, > Kewen > ----- > gcc/ChangeLog: > > * ipa-fnsummary.c (inline_read_section): Unpack a dummy bit > to keep consistent with the side of streaming out. > > --- > diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c > index 18bbae145b9..bf635c1f78a 100644 > --- a/gcc/ipa-fnsummary.c > +++ b/gcc/ipa-fnsummary.c > @@ -4403,13 +4403,20 @@ inline_read_section (struct lto_file_decl_data *f= ile_data, const char *data, > bp =3D streamer_read_bitpack (&ib); > if (info) > { > - info->inlinable =3D bp_unpack_value (&bp, 1); > - info->fp_expressions =3D bp_unpack_value (&bp, 1); > + info->inlinable =3D bp_unpack_value (&bp, 1); > + /* On the side of streaming out, there is still one bit > + streamed out between inlinable and fp_expressions bits, > + which was used for cilk+ before but now always false. > + To remove the bit packing need to bump LTO minor version, > + so unpack a dummy bit here to keep consistent instead. */ > + bp_unpack_value (&bp, 1); > + info->fp_expressions =3D bp_unpack_value (&bp, 1); > } > else > { > - bp_unpack_value (&bp, 1); > - bp_unpack_value (&bp, 1); > + bp_unpack_value (&bp, 1); > + bp_unpack_value (&bp, 1); > + bp_unpack_value (&bp, 1); > } > > count2 =3D streamer_read_uhwi (&ib); >