This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: gcc miscompiles HAL_DISABLE_INTERRUPTS on Cortex-M3
On 16.02.2011 15:21, Christophe Coutand wrote:
> What happens if you change the macro to this:
>
> # define HAL_DISABLE_INTERRUPTS(__old) \
> __asm__ volatile ( \
> "mrs %0, basepri \n" \
> "mov r1,%1 \n" \
> "msr basepri,r1 \n" \
> : "=r" (__old) \
> : "I" (CYGNUM_HAL_CORTEXM_PRIORITY_MAX)\
> : "r1" \
> );
>
> I usually use I (Immediate value) but I am not so use to ARM processor.
Yup. Either this or
"=&r" (__old)
(earlyclobber - clobbering before using all inputs) work.
Thanks, I am going to submit the bugreport.
--
Stano
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss