From patchwork Thu Dec 12 14:35:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1208547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515799-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="s4kjI+nP"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47YbvN0ss1z9sPh for ; Fri, 13 Dec 2019 01:35:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=R+Fq1N1HbSmzXxX+G1GDzohamcQDH5+hI/dIhQ5lk499AxS1TcIYd uq9cqxqeawEAmCUMrzVTHMGZ31jRFDfik0Zm8xTMwhayZec9o42R/Bm3l4KbQALt 7IInelqLAnJ8hY4YMRq1lCv+KCfnahCJpoWyCESjOC+WgzrLnQGURo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=ypyqfTqg1xDIjXKFOviAh9e98nk=; b=s4kjI+nPJJpix5zLURBj DJzyvj8Mlao4Z5lu84T4D7uAzn6w6kSrjrR9k+AjA4mzDPU7gGKTB+qcdGyl2JQ3 9VLtoFPNVBwxqtLNDDtJYF/4TkFubKRuy/BmIk4UrQwBHeDgDUidT/5yTHm0K350 gJvtWf62Zq15OoYyrtCq8Sc= Received: (qmail 125446 invoked by alias); 12 Dec 2019 14:35:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 125437 invoked by uid 89); 12 Dec 2019 14:35:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=honza, backport X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Dec 2019 14:35:48 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 2148B280832; Thu, 12 Dec 2019 15:35:46 +0100 (CET) Date: Thu, 12 Dec 2019 15:35:46 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix ipa-cp bit propagation streaming Message-ID: <20191212143546.wusbyi263hzd55et@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this rather nasty bug makes value and mask to be exchanged during streaming. This makes us to sometimes set bogus pointer alignments and causes misoptimization of Firefox when built with GCC 9. Comitted as obvious. I will backport it to release branches soon - it is quite dangerous bug. Honza * ipa-prop.c (read_ipcp_transformation_info): Fix undefined ordering of execution of function call parameters. Index: ipa-prop.c =================================================================== --- ipa-prop.c (revision 278815) +++ ipa-prop.c (working copy) @@ -4715,9 +4715,10 @@ read_ipcp_transformation_info (lto_input bool known = bp_unpack_value (&bp, 1); if (known) { + const widest_int value = streamer_read_widest_int (ib); + const widest_int mask = streamer_read_widest_int (ib); ipa_bits *bits - = ipa_get_ipa_bits_for_value (streamer_read_widest_int (ib), - streamer_read_widest_int (ib)); + = ipa_get_ipa_bits_for_value (value, mask); (*ts->bits)[i] = bits; } }