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: Question about how to re-initialize call_used registers via init_regs()


gcc-patches-owner@gcc.gnu.org wrote on 03.12.2008 23:10:02:

> On Wed, Dec 03, 2008 at 11:15:13AM +0100, Kai Tietz wrote:
> > Hi Honza,
> > 
> > Related to the problem 38366 me and M. Lankhorst (a wine developer), 
that 
> > you were right, that the registers %rsi and %rdi aren't saved for 
callabi 
> > switching by ms_abi functions calling sysv_abi. This is reasoned by 
the 
> > fact that the fndecl based conditional register usage macro (in 
i386.h) 
> > calls  init_regs (from regclass.c), which resets it back to the 
standard 
> > register usage, so this code is somehow meaning less at the moment.
> > I tried it by generate a init_regs_after method (like the init_regs in 

> > regclass.c), which simply does not reset back to the initial register 
> > usage set, and use it in the OVERRIDE_REGISTER_USAGE. But this seems 
to 
> > lead to bootstrap failures on linux64 targets. What way you would 
suggest 
> > to solve this problem?
> 
> The function specific support that I added when I was working at AMDcan 
change
> which registers are used/defined/etc.  I would suggest hooking in with 
the
> function specific support, perhaps making ms_abi/sysv_abi internallyset 
to use
> a different function specific option internally for the non-default 
option.
> 
> -- 
> Michael Meissner, IBM
> 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
> meissner@linux.vnet.ibm.com
> 

Hmm, well. I moved (and adjusted) the code into the the method you 
suggested. It works so far good, but still the register usage seems not to 
be treated wrong for sysv call from ms_abi context on linux64. The problem 
is that rsi and rdi aren't call used in ms_abi, so on modifications it 
should save them, but this doesn't happens for sysv argument passing.

Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.


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