This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
RE: [PATCH] fix profiling
Brian Dessent wrote on 05 August 2008 06:28:
> Brian Dessent wrote:
>
>> Since this code is lifted from the BSDs I did check that this change was
>> made there as well, e.g.
>>
<http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/i386/include/profile.h?r
ev=1.10&content-type=text/x-cvsweb-markup>.
Adding 'volatile' to asms that didn't need it could never do any harm,
anyway, apart from the minor missed-optimisation opportunities it implies,
but correctness is more important here!
> Actually, I also missed that the above version uses +r instead of =r for
> the second constraint. I guess we should make that change too.
I think that change is wrong. The register is written, not read; the
input value is not used. (The fact it is used as a source operand in the
second instruction doesn't matter, because it's not the input value being
used there but the previously-written value that just clobbered the input
value). It looks like a misunderstanding of what read-write means in terms
of gcc constraints.
cheers,
DaveK
--
Can't think of a witty .sigline today....