Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fveWR-0005IS-K6 for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Aug 2018 08:11:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fveWQ-0001fw-17 for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Aug 2018 08:11:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fveWP-0001fo-Mh for pgsql-hackers@lists.postgresql.org; Fri, 31 Aug 2018 08:11:13 +0000 Received: from gauss.credativ.com ([93.94.130.89]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fveWM-0003r4-O2 for pgsql-hackers@postgresql.org; Fri, 31 Aug 2018 08:11:12 +0000 Received: from gauss.credativ.com (localhost [127.0.0.1]) by gauss.credativ.com (Postfix) with ESMTP id 89C7E1E1EA9; Fri, 31 Aug 2018 10:11:07 +0200 (CEST) Received: from kohn.fritz.box (ppp-88-217-96-61.dynamic.mnet-online.de [88.217.96.61]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mba@gauss.credativ.com) by gauss.credativ.com (Postfix) with ESMTPSA id 2C8341E1C14; Fri, 31 Aug 2018 10:11:07 +0200 (CEST) Message-ID: <1535703067.1286.10.camel@credativ.de> Subject: Re: pg_verify_checksums and -fno-strict-aliasing From: Michael Banck To: Tom Lane , Andres Freund Cc: Magnus Hagander , Fabien COELHO , pgsql-hackers Date: Fri, 31 Aug 2018 10:11:07 +0200 In-Reply-To: <7502.1535670135@sss.pgh.pa.us> References: <1535618100.1286.3.camel@credativ.de> <7321.1535639966@sss.pgh.pa.us> <1535660901.1286.8.camel@credativ.de> <25968.1535663968@sss.pgh.pa.us> <20180830214606.xpm4bho5nmhfuzlx@alap3.anarazel.de> <20180830220409.4zhdka6ibs66enbk@alap3.anarazel.de> <28544.1535667100@sss.pgh.pa.us> <20180830223315.m2lc57oay3kztjz4@alap3.anarazel.de> <7502.1535670135@sss.pgh.pa.us> Organization: credativ GmbH Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Am Donnerstag, den 30.08.2018, 19:02 -0400 schrieb Tom Lane: > Andres Freund writes: > > On 2018-08-30 18:11:40 -0400, Tom Lane wrote: > > > I suspect people will complain about the added cost of doing that. > > I think the compiler will just optimize it away. > > Maybe. In any case, the attached version avoids any need for memcpy > and is, I think, cleaner code anyhow. It fixes the problem for me > with Fedora's gcc, though I'm not sure that it'd be enough to get rid > of the warning Michael sees (I wonder what compiler he's using). This fixes the bogus checksums, thanks! I am on Debian stable, i.e. 'gcc version 6.3.0 20170516 (Debian 6.3.0- 18+deb9u1)'.  The warning shows up only if I add -Wall *and* -O2 to CFLAGS, I think I did not mention that explictly before. As it is in pg_verify_checksums.c I need Magnus' patch as well to make it go away. But the warning is independent of the runtime issue so less of an issue (but probably worth fixing). Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: michael.banck@credativ.de credativ GmbH, HRB Mönchengladbach 12080 USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer Unser Umgang mit personenbezogenen Daten unterliegt folgenden Bestimmungen: https://www.credativ.de/datenschutz