This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: DX register is not a return value for i386?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- Date: Fri, 30 Aug 2013 08:01:27 -0700
- Subject: Re: DX register is not a return value for i386?
- Authentication-results: sourceware.org; auth=none
- References: <CAMbmDYaPp7mVEiEQ9PFC9MJ9+PQ5cCmvJNTNJwyUqy0wxHMY6A at mail dot gmail dot com> <CAMe9rOo1fj_x59Si0Kz9Gn0dOxLMHbTPE4vzfJ47XFBh+1FDow at mail dot gmail dot com> <CAMbmDYYA2J4MejzwEEgxubiTutufDCiOu=GPeVzxDE3F1sip2w at mail dot gmail dot com>
On Fri, Aug 30, 2013 at 1:54 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> 2013/8/29 H.J. Lu <hjl.tools@gmail.com>:
>> On Thu, Aug 29, 2013 at 7:33 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>> Hi,
>>>
>>> function_value_regno_p hook implementation for i386 target
>>> (ix86_function_value_regno_p) always returns false for DX register.
>>> But DX register is used to return 128 bit values an AX:DX. Is it
>>> intentional or a bug?
>>>
>>> I'm asking because it causes problem with mode switching which fails
>>> if see 'use' insn at the end of the function whose argument is not a
>>> register holding returned value. I'm choosing what should be fixed
>>> here, a mode switching or a hook implementation.
>>>
>>
>> It is not just %dx. %st1 and %xmm1 are used to return
>> complex value. You need to check hard_regno_nregs for
>> how many hard registers are used.
>
> It assumes returned value is always store in consecutive registers,
> right?. In MPX when we return structure in ax:dx with bounds in
> bnd0:bnd1, it does not work.
So the problem is ax+bnd0, not ax + dx. This is a new problem
for MPX. For return value in DImode, bnd0 is used if return value
is a pointer. If it is the case, you need to modify the code to handle
it.
--
H.J.