Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B89C49FC0B9 for ; Thu, 12 Jul 2007 19:07:49 -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 61598-03 for ; Thu, 12 Jul 2007 19:07:35 -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.186]) by postgresql.org (Postfix) with ESMTP id C60529FC0B8 for ; Thu, 12 Jul 2007 19:07:44 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id f5so20682nfh for ; Thu, 12 Jul 2007 15:07:39 -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=adMurV94gHHL79aGJVz7LeLpovpuYYHL+/voWT9Mt/StyzCL9RJQGUkfY7Oi6lxD7sxDfMxCmR8gPHM51MzhX/wm9Pquv8TfXKVPmB4DlrqghqPMwaIZ4JIujGqpy0WuFaxtvdMkK7PgzohNZFceuqmRBCCjEwyzCMW3FANtRvQ= 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=ZlyjbVD762R0N2E2VfzJgx8S71wV98NzddQ4MklVIyWAr8db/R4SWn6CfkfUZr3eQUwtpWixQRtEtv3bywip1r3S0oVzoRWz6P8FbOv/CmA/oClEhYy/uPUB4pCwoB53DFaDtYlgkMXzJ7uAa/szraADoP4Qe9Vr4OKNkMDvOno= Received: by 10.82.182.1 with SMTP id e1mr1328872buf.1184278056345; Thu, 12 Jul 2007 15:07:36 -0700 (PDT) Received: from ?192.168.1.33? ( [86.27.69.36]) by mx.google.com with ESMTP id d27sm7835126nfh.2007.07.12.15.07.32 (version=SSLv3 cipher=RC4-MD5); Thu, 12 Jul 2007 15:07:34 -0700 (PDT) Message-ID: <4696A5F1.3010103@enterprisedb.com> Date: Thu, 12 Jul 2007 23:06:41 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Alvaro Herrera CC: Stefan Kaltenbrunner , Tom Lane , 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> In-Reply-To: <20070712213806.GE22973@alvh.no-ip.org> 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/351 X-Sequence-Number: 105266 Alvaro Herrera wrote: > Heikki Linnakangas wrote: >> Alvaro Herrera wrote: >>> Stefan showed me via Jabber this warning: >>> /tmp/ccM7MfqX.s: Assembler messages: >>> /tmp/ccM7MfqX.s:703: Warning: 00000003fffffffc shortened to >>> 00000000fffffffc >>> /tmp/ccM7MfqX.s:738: Warning: 00000003fffffffc shortened to >>> 00000000fffffffc >>> He says that this comes from trgm_op.c file. I don't get the warning >>> myself obviously, so I started guessing. >>> 3FFFFFFFC = 1111111111111111111111111111111100 >>> FFFFFFFC = 11111111111111111111111111111100 >>> So the upper 2 bits are being lost (the second number is 32 bits wide). >>> The only thing that I think is related is the usage of VARSIZE(). It >>> looks like 0x3FFFFFFF (actual constant in the toast code) is shift two >>> bits left. I can see no such operation though. >> The shift is in postgres.h, SET_VARSIZE_4B. I have no idea where that >> warning is coming from, though. What's the real source behind "ccM7MfqX.s"? > > trgm_op.c > > I'm not sure that the shift in SET_VARSIZE_4B is applicable here, > because it would have to be passed a len of FFFFFFFF. 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++; > } Line 224: > ptr = GETARR(trg); > while (ptr - GETARR(trg) < ARRNELEM(trg)) > { >>>>> pfree(DatumGetPointer(d[ptr - GETARR(trg)])); > ptr++; > } The warning seems to be in related array indexing. If you replace ptr - GETARR(trg) with a constant, the warning goes away. But having "i = ptr - GETARR(trg)" in there doesn't give a warning. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com