Commit 7a708f68 by Uros Bizjak

re PR rtl-optimization/66838 (Calling multiple SYSV AMD64 ABI functions from MS…

re PR rtl-optimization/66838 (Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters)

	PR rtl-optimization/66838
	* postreload.c (reload_cse_move2add): Also process
	CALL_INSN_FUNCTION_USAGE when resetting information of
	call-clobbered registers.

testsuite/ChangeLog:

	PR rtl-optimization/66838
	* gcc.target/i386/pr66838.c: New test.

From-SVN: r225806
parent 73bf400d
2015-07-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/66838
* postreload.c (reload_cse_move2add): Also process
CALL_INSN_FUNCTION_USAGE when resetting information of
call-clobbered registers.
2015-07-14 Sandra Loosemore <sandra@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
......
......@@ -2127,12 +2127,29 @@ reload_cse_move2add (rtx_insn *first)
unknown values. */
if (CALL_P (insn))
{
rtx link;
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
{
if (call_used_regs[i])
/* Reset the information about this register. */
reg_mode[i] = VOIDmode;
}
for (link = CALL_INSN_FUNCTION_USAGE (insn); link;
link = XEXP (link, 1))
{
rtx setuse = XEXP (link, 0);
rtx usage_rtx = XEXP (setuse, 0);
if (GET_CODE (setuse) == CLOBBER
&& REG_P (usage_rtx))
{
unsigned int end_regno = END_REGNO (usage_rtx);
for (unsigned int r = REGNO (usage_rtx); r < end_regno; ++r)
/* Reset the information about this register. */
reg_mode[r] = VOIDmode;
}
}
}
}
return changed;
......
2015-07-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/66838
* gcc.target/i386/pr66838.c: New test.
2015-07-14 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/66850
......@@ -427,7 +432,7 @@
* gcc.target/arm/attr_thumb-static.c: Test for all targets.
Fix return value.
2015-05-05 Jakub Jelinek <jakub@redhat.com>
2015-07-06 Jakub Jelinek <jakub@redhat.com>
PR target/65956
* gcc.c-torture/execute/pr65956.c: New test.
......
/* { dg-do run { target lp64 } } */
/* { dg-options "-O2" } */
void abort (void);
char global;
__attribute__((sysv_abi, noinline, noclone))
void sysv_abi_func(char const *desc, void *local)
{
register int esi asm ("esi");
register int edi asm ("edi");
if (local != &global)
abort ();
/* Clobber some of the extra SYSV ABI registers. */
asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
: "=r" (esi), "=r" (edi)
: "i" (0xdeadbeef));
}
__attribute__((ms_abi, noinline, noclone))
void ms_abi_func ()
{
sysv_abi_func ("1st call", &global);
sysv_abi_func ("2nd call", &global);
sysv_abi_func ("3rd call", &global);
}
int
main(void)
{
ms_abi_func();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment