On Fri, Aug 31, 2012 at 2:03 PM, Crazy Casta <crazyca...@gmail.com> wrote:

> Add a compiler directive of some sort that says the next assignment
> statement must be compiled atomically (|=, &=, +=, -=, /=, *=, etc.) must
> be done with an atomic instruction. Obviously /= and *= would fail
> automatically because there are no atomic instructions for those on the
> MSP430.

I think by now we established that it is not possible to express such
low-level hardware-specific compiler behavior  in standard C.  This
discussion is about using compiler heuristic or, as you propose,
compiler extensions, to work around this limitation.

It seems to me that a better approach is to admit the reality that
it's a hardware specific operation, and express it via the appropriate
asm(), perhaps with some syntactic sugar of function/library calls.

I see little or no benefit to trying to do it in custom C extensions,
or even in custom standard-C idioms.  I guess people feel that it
would make code more portable, but in reality it would neither port to
other compilers nor even to other architectures in GCC---since it is
not required by the language standard, it would be an assumption,
requiring re-qualifying for each backend revision.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to