Re: Intermediate report for AIX 5L port - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Intermediate report for AIX 5L port
Date
Msg-id 3C155914.BD00207C@fourpalms.org
Whole thread Raw
In response to Re: Intermediate report for AIX 5L port  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Intermediate report for AIX 5L port  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
...
> Declaring the lock pointer "volatile" seems to prevent this misbehavior.

Great. That is what it is anyway, right?

> Personally I'd call this a compiler bug; isn't it supposed to consider
> semicolons as sequence points?  I never heard that rearranging the order
> of stores into memory was considered a kosher optimization of C code.

Sure it is. Presumably "-O0" or equivalent would have kept this from
happening, but seemingly unrelated stores into non-overlapping memory
are always fair game at even modest levels of optimization. The "x = 0"
is cheaper than the other operations, though it may be reordered for
internal RISC-y reasons rather than "cheapest first" considerations.
                     - Thomas


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: about heap_insert() function
Next
From: Tom Lane
Date:
Subject: Re: Intermediate report for AIX 5L port