public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Preserve registers across function call (Re: CALL_USED_REGISTERS)
@ 2009-07-16  8:47 Makoto Fujiwara
  2009-07-16 15:26 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Makoto Fujiwara @ 2009-07-16  8:47 UTC (permalink / raw)
  To: gcc

  My name is Makoto Fujiwara, I am working a particular port
for private CPU (at the time being). The porting itself is
getting very well, I believe, say having more than 30,000 PASS
with testsuite. Although no execution available for that make check,
I am preparing gdb/sim based execution verification with separate
make check.

My question is: 

The (gccint) info says, 
-----------
If a register has 0 in `CALL_USED_REGISTERS',
 the compiler automatically saves it on function entry and
restores it on function exit, if the register is used within 
the function.
-----------
in the context attatched. ( I believe this info is with gcc-4.2.1)

But unfortunately, my port does not seem to work as described
above (no preserve code found at *.s output).  The port is
based on 4.2.1 for the moment. I know either cpu.h or cpu.md is 
wrong, but to trace the problem,

Could anyone suggest me which part of the src is taking care
of above save/restore processing ?  
  calls.c 
  function.c  -> expand_function_{start,end}()
  caller-save.c  -> save_call_clobbered_regs()
  reload1.c 
  or others ?
I believe it should be in function.c, but I can not figure out
which lines (function) to take care those things.
(or the explanation in info is obsolete ?)

Thanks in advance,
---
Makoto Fujiwara, 
Chiba, Japan, Narita Airport and Disneyland prefecture.

(attachment)
15.7.1 Basic Characteristics of Registers
-----------------------------------------

Registers have various characteristics.

 -- Macro: FIRST_PSEUDO_REGISTER
	...
 -- Macro: FIXED_REGISTERS
 	...    
 -- Macro: CALL_USED_REGISTERS
     Like `FIXED_REGISTERS' but has 1 for each register that is
     clobbered (in general) by function calls as well as for fixed
     registers.  This macro therefore identifies the registers that are
     not available for general allocation of values that must live
     across function calls.

     If a register has 0 in `CALL_USED_REGISTERS', the compiler
     automatically saves it on function entry and restores it on
     function exit, if the register is used within the function.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-17  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-16  8:47 Preserve registers across function call (Re: CALL_USED_REGISTERS) Makoto Fujiwara
2009-07-16 15:26 ` Richard Henderson
2009-07-17  9:17   ` Makoto Fujiwara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).