bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dere


From: Richard Braun
Subject: Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__
Date: Wed, 18 Dec 2013 00:14:27 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Dec 17, 2013 at 06:51:49PM +0100, Samuel Thibault wrote:
> I don't think we benefit very much here, do we?  restrict is a very
> difficult thing to maintain, few programmers really understand what it
> means, I'd rather avoid introducing too many of them.

I agree. Note that GNU Mach is built with -fno-strict-aliasing exactly
for such reasons, as are other well known projects. Besides, the
restrict keyword is only really useful when you have more than one
pointer of the same type, since strict aliasing would already apply for
pointers of different types. And as you mention it, the lock semantics
are actually what matter most here with regard to code ordering, and
they actually reduce the effectiveness of optimizations.

-- 
Richard Braun



reply via email to

[Prev in Thread] Current Thread [Next in Thread]