Hi, Please find the attached patch to avoid saving of EXR register for monitor functions.
By default, in prologue code of a monitor function, EXR register is
pushed onto the stack. This implementation is not required for H8S/224x
and 21xx variants of H8S controllers. The behavior can be controlled
with option "-mno-exr".
Built compiler is only for compiling C language source code. No
regression found with this patch.
Compiler behavior with different command line options used for
compilation of code after applying this patch is given below:
* h8300-elf-gcc -mn -S test.c
test.c:1:0: error: -mn is used without -mh or -ms or -msx
* h8300-elf-gcc -mh -mexr -S test.c
test.c:1:0: error: -mexr is used without -ms
* h8300-elf-gcc -mh -mno-exr -S test.c
test.c:1:0: warning: -mno-exr valid only with -ms or -msx
- Option ignored! [-mno-exr]
* Generated assembly without option '-mno-exr':
_testmonitor:
stc exr,@-er7
mov.l er0,@-er7
stc ccr,r0l
* Generated assembly with option '-mno-exr':
_testmonitor:
mov.l er0,@-er7
stc ccr,r0l
Please review the patch and let me know if there should be any
modifications in it?
Regards,
Sandeep Kumar Singh,
KPIT Cummins InfoSystems Ltd.
Pune, India
ChangeLog.patch
Description: ChangeLog.patch
patch-EXR.patch
Description: patch-EXR.patch
