This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Atomic Operations (continuing on from Masking Interrupts?)


>Some responses indicated that others have experienced this 'problem' before.
>As GCC and support for M68K have been around for quite some time I assume
>that a 'fix' in the compiler is probably difficult.

Part of the problem is that the language semantics can get in the way.  For
instance, if you do

foo = *ptr++;

You're insisting that the compiler load (for the assignment), and then do
the increment.  It probably figures that since the value's already in a
register, it should go ahead and increment it there, rather than using
an in-place instruction.  So, there probably isn't any sensible way for the
compiler (any compiler) to do what you want.  You can do some things in
your source code to make it easier for the compiler to do what you want,
though.

 - Ken Rose
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]