Re: compiler warnings on the buildfarm - Mailing list pgsql-hackers

From Tom Lane
Subject Re: compiler warnings on the buildfarm
Date
Msg-id 12639.1184279380@sss.pgh.pa.us
Whole thread Raw
In response to Re: compiler warnings on the buildfarm  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: compiler warnings on the buildfarm  (Heikki Linnakangas <heikki@enterprisedb.com>)
Re: compiler warnings on the buildfarm  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki@enterprisedb.com> 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?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: compiler warnings on the buildfarm
Next
From: Gregory Stark
Date:
Subject: Re: compiler warnings on the buildfarm