This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Question about how to re-initialize call_used registers via init_regs()
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>, Richard Guenther <rguenther at suse dot de>
- Date: Fri, 5 Dec 2008 10:30:05 +0100
- Subject: 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.