From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 653DD3858D3C for ; Tue, 21 Sep 2021 02:09:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 653DD3858D3C Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18L20lcM020681; Mon, 20 Sep 2021 22:09:06 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b7680r42y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 22:09:06 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18L295M1024247; Mon, 20 Sep 2021 22:09:05 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b7680r42e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 22:09:05 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18L28KZ4002075; Tue, 21 Sep 2021 02:09:02 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04fra.de.ibm.com with ESMTP id 3b57r9dnsa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Sep 2021 02:09:02 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18L24DGv55050674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Sep 2021 02:04:13 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08C2311C04A; Tue, 21 Sep 2021 02:09:00 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4780711C04C; Tue, 21 Sep 2021 02:08:57 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.200.63.17]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 21 Sep 2021 02:08:56 +0000 (GMT) Subject: Re: [PATCH] ipa-fnsummary: Remove inconsistent bp_pack_value To: Richard Biener Cc: GCC Patches , Jan Hubicka , =?UTF-8?Q?Martin_Li=c5=a1ka?= , Martin Jambor , Segher Boessenkool , Bill Schmidt References: From: "Kewen.Lin" Message-ID: Date: Tue, 21 Sep 2021 10:08:55 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7yfJKUGjCUOluNI8vmhr4c05WFjsCX4M X-Proofpoint-GUID: C4gJfRVP8oHecKvlB5xfvHuIYhT2dp3n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-20_11,2021-09-20_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109210011 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 02:09:08 -0000 Hi Richi, Thanks for the review! on 2021/9/17 下午6: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 = 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. > 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? 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 *file_data, const char *data, bp = streamer_read_bitpack (&ib); if (info) { - info->inlinable = bp_unpack_value (&bp, 1); - info->fp_expressions = bp_unpack_value (&bp, 1); + info->inlinable = 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 = 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 = streamer_read_uhwi (&ib);