Re: Warning in the RecordTransactionAbort routine during compilation with O3 flag

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Warning in the RecordTransactionAbort routine during compilation with O3 flag
Date: 2019-12-10 07:18:49
Message-ID: 04868ee5-4d76-2798-0010-0f4b478e7762@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

10.12.2019 08:13, Michael Paquier wrote:
> On Mon, Dec 09, 2019 at 02:03:43PM +0500, Andrey Lepikhov wrote:
>> We already have assertion on the twophase_gid variable. But compiler is not
>> so smart and can't find a link between the XACT_XINFO_HAS_GID flag and
>> state of twophase_gid pointer.
>
> Well, gcc-9 got visibly smarter on that point :)
>
>> Ok. In accordance with your review, I have prepared a new version of the
>> patch.
>
> Regarding formatting.c, I can see the point of avoiding future
> mistakes, and I would go a bit further as per the attached for
> consistency between all variables. have_error is a bit trickier
> though as it gets moved around more layers so doing an initialization
> in the middle is not really an option. Anyway, we can do that rather
> cleanly from the entry point of do_to_timestamp() to bring more
> consistency for variables which are always expected and the optional
> ones. What do you think?

I have small experience in formatting.c code. But this patch and idea
looks good.

>
> For the second one in xact.c, I am not really on board of doing
> something based on the proposals because this reduces the code
> visibility, and gcc is clearly wrong in its assumptions because the
> state cannot be reached.

Ok. I switched to gcc-9 and now have no problem.

--
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Etsuro Fujita 2019-12-10 09:33:08 Re: BUG #16139: Assertion fails on INSERT into a postgres_fdw' table with two AFTER INSERT triggers
Previous Message Michael Paquier 2019-12-10 05:38:15 Re: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query