[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: [PATCH] timecounters: Fix timehand generation read/write
From:       Sebastian Huber <sebastian.huber () embedded-brains ! de>
Date:       2015-06-09 7:23:51
Message-ID: 55769487.20901 () embedded-brains ! de
[Download RAW message or body]



On 04/06/15 20:10, Joerg Sonnenberger wrote:
> On Wed, Jun 03, 2015 at 11:00:53PM +0200, Sebastian Huber wrote:
>> In my interpretation of the C standard this is implementation defined be=
haviour.  See also:
>>
>> https://gcc.gnu.org/onlinedocs/gcc/Volatiles.html
> I don't think that is nearly correct as far as any data accessibly from
> global objects is concerned beside the volatile. C11 5.1.2.3 (2) and (3)
> are the relevant clauses. An assignment to a volatile object is a
> sequence point with side effects. All assignments before that sequence
> point must be visible to whatever possible side effect the volatile has.
> Similar, it can implicitly change all globals, so no read can be moved
> from after the sequence point to before. This is much stricter than the
> normal as-if rule, since a sequence of side-effect-free operations can
> be implemented anyway the compiler likes. A different interpretation
> would be quite questionable.
>
> Note that this is all just about the rules of the C abstract machine. It
> is not about the observable behavior of a multi-processor machine.
> Whether or not TSO is enough for this purpose is a completely different
> question.

I didn't want to start a discussion about the C standard interpretation. =

GCC generates code according to their documentation:

https://lists.freebsd.org/pipermail/freebsd-hackers/2015-May/047778.html

In case you think GCC is doing something wrong, then maybe you can file =

a bug report for GCC.

Anyway we need real memory barriers.

-- =

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine gesch=E4ftliche Mitteilung im Sinne des EHUG.

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic