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: [PATCH, i386]: Fix PR 58792 by adding missing registers to ix86_function_value_regno_p


On Sat, Oct 19, 2013 at 2:55 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> The list of possible return registers in ix86_function_value_regno_p
> is incomplete.  32bit and 64bit targets use %[er]dx register for
> DImode and TImode values respectively and %st(1) and %xmm1 for
> imaginary part of complex values. Additionally, 64bit SYSV targets use
> %rdi and %rsi registers to pass structures (as declared in
> x86_64_int_return_registers array).
>
> function_value_regno_p is mainly used in (obsolete) __builtin_apply
> and __builtin_return builtins, but it is also used in mode-switching
> pass to check if regno is OK as multiple register value return.
>
> Attached patch fixes PR 58792 by adding missing registers to
> function_value_regno_p.
>
> 2013-10-19  Uros Bizjak  <ubizjak@gmail.com>
>
>     PR target/58792
>     * config/i386/i386.c (ix86_function_value_regno): Add DX_REG,
>     ST1_REG and XMM1_REG for 32bit and 64bit targets.  Also add DI_REG
>     and SI_REG for 64bit SYSV ABI targets.
>
> The patch was tested on x86_64-pc-linux-gnu {,-m32}, also with
> '--with-arch=core-avx-i --with-cpu=core-avx-i --with-fpmath=avx'
> configured compiler for  all default languages, plus obj-c++ and go.
>
> I plan to commit the patch to all release branches after a week in mainline.
>
> Patch was committed to mainline, so automatic SPEC testers will pick
> it for additional testing.

Oh, I forgot to say that I tried to construct a C testcase to be put
in gcc.target/i386, but I was not able to trigger the assert. Since
the problem turned out to be quite obvious and with a  straightforward
fix, I gave up on the testcase.

Uros.


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