From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2063) id C8CA63858D39; Wed, 22 Sep 2021 04:54:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8CA63858D39 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kewen Lin To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-9740] ipa-fnsummary: Remove inconsistent bp_pack_value X-Act-Checkin: gcc X-Git-Author: Kewen Lin X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: 116d6d36a7cd164590e30d66d27a3ce95312ebad X-Git-Newrev: 9f7d2a6ae59872b13a5d228a2394f186e9495ba5 Message-Id: <20210922045417.C8CA63858D39@sourceware.org> Date: Wed, 22 Sep 2021 04:54:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2021 04:54:17 -0000 https://gcc.gnu.org/g:9f7d2a6ae59872b13a5d228a2394f186e9495ba5 commit r9-9740-g9f7d2a6ae59872b13a5d228a2394f186e9495ba5 Author: Kewen Lin Date: Tue Sep 21 19:13:57 2021 -0500 ipa-fnsummary: Remove inconsistent bp_pack_value There is one inconsistent bit-field streaming out and in. On the side of streaming in: bp_pack_value (&bp, info->inlinable, 1); bp_pack_value (&bp, false, 1); bp_pack_value (&bp, info->fp_expressions, 1); while on the side of the streaming out: info->inlinable = bp_unpack_value (&bp, 1); info->fp_expressions = bp_unpack_value (&bp, 1) The removal of Cilk Plus support r8-4956 missed to remove the streaming out of the bit, instead just change the value for streaming out to be always false. By hacking fp_expression_p to always return true, I can see it reads the wrong fp_expressions value (false) out in wpa. GCC12 adopts commit 63c6446f77b9001d26f973114450d790749f282b which removes the inconsistent streaming out instead. gcc/ChangeLog: * ipa-fnsummary.c (inline_read_section): Unpack a dummy bit to keep consistent with the side of streaming out. (cherry picked from commit cc11a171eee059b645870f2e208c530f301239c9) Diff: --- gcc/ipa-fnsummary.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 7c5562ad801..2b8c21ddd4f 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -3319,13 +3319,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);