Re: Re: [PATCHES] s_lock.h cleanup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCHES] s_lock.h cleanup
Date: 2001-01-19 18:49:26
Message-ID: 9599.979930166@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> And they may all be broken, except for the one(s) you have tested.
>> You shouldn't be assuming that a platform that uses gcc necessarily
>> also uses gas.

> I can tell you that they all used __asm__, and all used the colon
> terminators for each __asm__ block:

> * __asm__ __volatile__(
> * "command;"
> * "command;"
> * "command;"
> * : "=r"(_res) return value, in register
> * : "r"(lock) argument, 'lock pointer', in register
> * : "r0"); inline code uses this register

The __asm___ and splitting up the assembly code into multiple string
literals and the consistent formatting of the register addendums are
all fine, because those are read by gcc and this whole code block is
gcc-only. But the assembly code string literal will be spit out
essentially verbatim by gcc to the assembler, and the assembler may
not be nearly as forgiving as you think.

> Oh, wow, I never suspected gcc could work without gas. Can it?

Gcc with platform-specific as used to be the standard configuration
on HPUX, and may still be standard on some platforms.

Bottom line: I see no point in taking any risks, especially not this
late in beta, with code that you cannot test for yourself, and
*especially* not when the change is only for cosmetic reasons.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2001-01-19 19:13:54 RE: Possible performance improvement: buffer replacemen t policy
Previous Message Tom Lane 2001-01-19 18:43:22 Re: Re: Problems with BLOBs under Windows?

Browse pgsql-patches by date

  From Date Subject
Next Message Larry Rosenman 2001-01-19 19:24:10 Re: Re: [PATCHES] s_lock.h cleanup
Previous Message Bruce Momjian 2001-01-19 18:42:37 Re: Re: [PATCHES] s_lock.h cleanup