On Wed, Oct 24, 2012 at 12:38 AM, mind entropy <mindentr...@gmail.com>wrote:
>
> On Wed, Oct 24, 2012 at 12:36 PM, Eric Decker <cire...@gmail.com> wrote:
>
>>
>>
>> On Tue, Oct 23, 2012 at 11:14 PM, mind entropy <mindentr...@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I was reading the mspgcc manual (
>>>
>>> http://www.eecs.harvard.edu/~konrad/projects/motetrack/mspgcc-manual-20031127.pdf
>>> )
>>> and on Pg 39 its written as
>>>
>>
>> I believe there is a more up to date version but I'm not usre where it
>> lives. Perhaps Peter can point to it?
>>
>>
>>>
>>> "If you execute
>>> while ((long) a & 0x80000l);
>>> the program will hang, unless ’a’ is declared volatile. So, do it!"
>>>
>> With optimization a will be put into a register (actually two registers
>> since it is a long) and loaded once.
>>
>> If a is declared as a volatile, that tells the toolchain that a can
>> change out from underneath any assumptions
>> made about contents. This forces the compiler to reload a into a
>> register each iteration.
>>
>
> Its loaded once during the start of the iteration right? Theoretically
> if there is no change from outside is there a point
> in making it volatile? i.e. if that loop block is the only thing in
> the loop?
>
> If it applies to long then it should apply to double and float also
> right?
>
sure. it should.
>
>>> I did not get it. Why should it hang?
>>>
>>> Thanks,
>>> Gautam.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>> _______________________________________________
>>> Mspgcc-users mailing list
>>> Mspgcc-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>>>
>>>
>>
>>
>> --
>> Eric B. Decker
>> Senior (over 50 :-) Researcher
>>
>>
>>
>
--
Eric B. Decker
Senior (over 50 :-) Researcher
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users