Open Source Tools Support

Open Source Tools Support
664 Rep. 54 Answers 3 Questions 2 Followers 0 Following
The official account for all technical support issues for the Open Source Tools for Renesas platform at


  • 54 answers, 7 selected
  • 3 questions, 0 solved
  • Member for 8 years, 7 months, 30 days
  • 51401 profile views
  • Last seen 4 days ago


Total 664
5 days ago Commented Hello, A fix was included regarding this issue in the GCC for Renesas RX release. When using -mint-register=2 -msmall-data-limit=512, RX produces the following instructions: Source code: #include "iodefines.h" unsigned char Buffer[32]; unsigned char* pHead; unsigned char* pTail; volatile unsigned char Data; void ServiceFastRXI1(void) __attribute__ ((fast_interrupt,optimize("-O2"))); void ServiceFastRXI1(void) { *pHead++ = SCI1.RDR; *pTail++ = Data++; if(&Buffer[32] == pHead) { pTail = pHead = &Buffer[0]; } ICU.IER[15].BIT.IEN6 = 1; return; } void main(void) { int i; pTail = pHead = &Buffer[0]; i = (int)&ServiceFastRXI1; return; } Compiled output: .file "test.c" .section P,"ax" .comm _Buffer,32,1 .comm _pHead,4,4 .comm _pTail,4,4 .comm _Data,1,1 .global _ServiceFastRXI1 .type _ServiceFastRXI1, @function _ServiceFastRXI1: ; Note: Fast Interrupt Handler pushm r1-r5 mov.L #_pHead, r5 mov.L [r5], r3 mov.L #_Data, r1 mov.L #_pTail, r4 add #1, r3, r2 mov.L r2, [r5] mov.L #0x8a020, r2 mov.B 5[r2], r2 mov.B r2, [r3] mov.B [r1], r2 mov.L [r4], r3 add #1, r2, r13 add #1, r3, r12 mov.B r13, [r1] mov.L r12, [r4] mov.B r2, [r3] mov.L [r5], r3 cmp #_Buffer+32, r3 beq .L5 mov.L #0x87000, r5 bset #6, 527[r5].B popm r1-r5 rtfi .L5: mov.L #_Buffer, [r5] mov.L #_Buffer, [r4] mov.L #0x87000, r5 bset #6, 527[r5].B popm r1-r5 rtfi .size _ServiceFastRXI1, .-_ServiceFastRXI1 .global _main .type _main, @function _main: push.l r10 add #-4, r0, r10 mov.L r10, r0 mov.L #_pHead, r5 mov.L #_Buffer, [r5] mov.L #_pHead, r5 mov.L [r5], r4 mov.L #_pTail, r5 mov.L r4, [r5] mov.L #_ServiceFastRXI1, [r10] nop rtsd #8, r10-r10 .size _main, .-_main .ident "GCC: (GCC_Build_8c9e6e87e) 20190222" Due to mint-registers being set to 2, GCC is free to use/allocate/trash r13 and r12 in the fast interrupt function, without saving and restoring them. Due to msmall-data-limit > 0, GCC will not allocate r11 anywhere. If you encountered a different behavior, please let us know. Best regards, The Open Source Tools Team


5 votes received 100/100 5up 0down
4 votes casted 100/100 4up 0down

New questions

No question asked yet!