This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH H8300] Added -mno-exr option in case of function with "monitor" attribute


On 03/30/2012 08:13 AM, Sandeep Kumar Singh wrote:
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?	
This looks pretty good. Just a couple minor issues.

First, do you have an assignment on file with the FSF. I note several other engineers at KPIT have assignments, but I'm not aware of one for you. That will need to be taken care of before we can accept the code.


My recollection was -mint32 was supported on the original H8/300; is there something in particular that makes you want to issue an error for that case? Or is my memory incorrect?


In h8300.opt, rather than say "Push exr on stack", would it make more sense to say "[Do not] Push extended registers on stack in monitor functions"?

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]