Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E88189FBDF0 for ; Thu, 12 Jul 2007 19:41:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 66386-10 for ; Thu, 12 Jul 2007 19:41:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by postgresql.org (Postfix) with ESMTP id E81CD9FB95D for ; Thu, 12 Jul 2007 19:41:40 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id f5so21390nfh for ; Thu, 12 Jul 2007 15:41:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=t7R/04zCwUePQe+oGz9nDwzgs+pRJBALOiWC8+iWHRXqpnPahAp+hGa2J8Nw4Bx5TxKPQGhYEJbdGLR1xdbaGnx1/NTrQzgLGTPw7URNgwdSNiEs7Qdn2Dam6KeStfljTZJzA962alwow2AI9xZGaWVp+UZJTg0aSWgqvv+caQ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=WatsQomd42XVCmwGbopTYZHvBBLhfMp05ClWag2a0OiD+wQYzbw4mu2XJBzEfYDYPrOvzeeNyL+QEmtcyriqEXGRlOmGSqP81o5xtSOqMfTSnLYtuCVO+kyaTR8tiw44HKiRS2ySH5kxF6ayrisqcMmfgNdNBgUdx2r9LoHiGDU= Received: by 10.82.106.14 with SMTP id e14mr1393222buc.1184280095701; Thu, 12 Jul 2007 15:41:35 -0700 (PDT) Received: from ?192.168.1.33? ( [86.27.69.36]) by mx.google.com with ESMTP id k5sm4192796nfh.2007.07.12.15.41.32 (version=SSLv3 cipher=RC4-MD5); Thu, 12 Jul 2007 15:41:33 -0700 (PDT) Message-ID: <4696ADEA.1040804@enterprisedb.com> Date: Thu, 12 Jul 2007 23:40:42 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Tom Lane CC: Alvaro Herrera , Stefan Kaltenbrunner , PostgreSQL-development Subject: Re: compiler warnings on the buildfarm References: <46962BBD.5000108@kaltenbrunner.cc> <17428.1184249229@sss.pgh.pa.us> <469653BA.2040004@kaltenbrunner.cc> <20070712211918.GD22973@alvh.no-ip.org> <46969C98.60207@enterprisedb.com> <20070712213806.GE22973@alvh.no-ip.org> <4696A5F1.3010103@enterprisedb.com> <12639.1184279380@sss.pgh.pa.us> In-Reply-To: <12639.1184279380@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/355 X-Sequence-Number: 105270 Tom Lane wrote: > Heikki Linnakangas writes: >> Hmm. It looks like I get that warning on my laptop as well. I tracked it >> down to these two places: > >> Line 209: >>> while (ptr - GETARR(trg) < ARRNELEM(trg)) >>> { >>> text *item = (text *) palloc(VARHDRSZ + 3); >>> >>> SET_VARSIZE(item, VARHDRSZ + 3); >>> CPTRGM(VARDATA(item), ptr); >>>>> d[ptr - GETARR(trg)] = PointerGetDatum(item); >>> ptr++; >>> } > > I'll betcha the compiler is trying to optimize the repeated calculations > of "ptr - GETARR(trg)" into a separate variable that it increments along > with ptr. Maybe it is getting it wrong, or maybe the assembler is just > confused. Does the warning go away if you dial down the -O level? Yes, I don't get it with -O1 or -O0. $ gcc --version gcc (GCC) 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) Hmm. Prerelease? This version came from debian/testing. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com