On Fri, Aug 30, 2013 at 1:54 AM, Ilya Enkovich <[email protected]> wrote: > 2013/8/29 H.J. Lu <[email protected]>: >> On Thu, Aug 29, 2013 at 7:33 AM, Ilya Enkovich <[email protected]> >> 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.
