[superh-gnu-discuss] SH interrupt_handler function attribute register saving

Andrew Stubbs ams at codesourcery.com
Mon Oct 12 09:09:07 UTC 2009


Hi Benjamin,

I am a little confused about the origin of your toolchain. Please could 
I ask you to post the output from gcc's --version option.

Thanks

Andrew

On 09/10/09 10:46, Benjamin Heyne wrote:
> Hi all,
> I am currently implementing some interrupt routines for a SH2A device.
>
> The interrupt function is defined like this:
> void __attribute__ ((interrupt_handler)) INT_CMT1_CMI1(void)
> {
>      //do something
> }
>
> Unfortunately the programm crashes after the first interrupt. When looking
> into the generated function entry/exit code by gcc, I noticed a mismatch
> between the saved and rescued registers from stack:
>
> 00002180 2F06              MOV.L     R0, at -R15
> 00002182 2F16              MOV.L     R1, at -R15
> 00002184 2F26              MOV.L     R2, at -R15
> 00002186 2F36              MOV.L     R3, at -R15
> ....
> 000021A4 67F6              MOV.L     @R15+,R7
> 000021A6 66F6              MOV.L     @R15+,R6
> 000021A8 65F6              MOV.L     @R15+,R5
> 000021AA 64F6              MOV.L     @R15+,R4
> 000021AC 002B              RTE
> 000021AE 0009              NOP
>
>
> Now, several questions arise:
> Is this a bug? Did I do something wrong? Is there any way around (except
> writing the routine in assembler by hand...)?
>
> --
> Best regards
> Benjamin Heyne
>
>




More information about the superh-gnu-discuss mailing list