From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 2A0593858025 for ; Fri, 17 Sep 2021 10:04:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A0593858025 Received: by mail-ed1-x532.google.com with SMTP id h17so28029287edj.6 for ; Fri, 17 Sep 2021 03:04:19 -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; bh=Walpfa/a4MyoqlRDi8bzKCG6DOeC9eAN9YcL2X38jKg=; b=ptH00NWnYgIvtFvRxwOn2G93WNAgDT/IuD+KFVz4FT3BG7kFuzppp3jgoiWOUb6dpP BqFcPLL9hEgtzI6m4tUnxiFQYA+Z2Gnr82zTSMWfiadaY2pkAFmXgrgAR+MxPL1xJoQ5 JBfehcJf/HfyML97LOsucgipiSp3h0xzaxp8nMCbaw+npPaRwN3afb5VDWfTx8VAMGrx yMeAn2nml/ZNS8CTMQozn/nVXfurRoJFgCmEkzPBXn1Cx1Oezdc8n3j74A+ct2EqgYke QFroNZG6Qud9nPh36obcLuDeJPbRTXZn/JPf6118IVfjBLIHCVYYW6dV1Ejr+SEWEum2 eJlg== X-Gm-Message-State: AOAM533s/gvcXhMNKGqMmLVnnqpQUMhx1W/U9ZTlIkC3vFjw2c1y8yYA E+7U0Cd0r7oDf+3ptBR7KBYH3nsrYRCOfKx2mLrxqRud X-Google-Smtp-Source: ABdhPJy9Y+ZBpOFGAQVj74A3aDBfUlg7Tq5Hyg4zSZIY0zyxGKupRL8Xn27I8tO5lSIVAFOnlPOPjTi/9s57RFx40aE= X-Received: by 2002:a50:e1c4:: with SMTP id m4mr3560084edl.307.1631873058060; Fri, 17 Sep 2021 03:04:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Fri, 17 Sep 2021 12:04:07 +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" X-Spam-Status: No, score=-8.6 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: Fri, 17 Sep 2021 10:04:20 -0000 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 = bp_unpack_value (&bp, 1); > > info->fp_expressions = 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. > Thanks, > Richard. > > > > > BR, > > Kewen > > ----- > > gcc/ChangeLog: > > > > * ipa-fnsummary.c (ipa_fn_summary_write): Remove inconsistent > > bitfield streaming out. > > > > diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c > > index 2470937460f..31199919405 100644 > > --- a/gcc/ipa-fnsummary.c > > +++ b/gcc/ipa-fnsummary.c > > @@ -4652,7 +4652,6 @@ ipa_fn_summary_write (void) > > info->time.stream_out (ob); > > bp = bitpack_create (ob->main_stream); > > bp_pack_value (&bp, info->inlinable, 1); > > - bp_pack_value (&bp, false, 1); > > bp_pack_value (&bp, info->fp_expressions, 1); > > streamer_write_bitpack (&bp); > > streamer_write_uhwi (ob, vec_safe_length (info->conds));