Commit 951d8c8a by Eric Botcazou Committed by Eric Botcazou

* function.c (assign_parm_setup_reg): Prevent sharing in another case.

From-SVN: r237703
parent b60fc3bd
2016-06-22 Eric Botcazou <ebotcazou@adacore.com>
* function.c (assign_parm_setup_reg): Prevent sharing in another case.
2016-06-22 Bernd Edlinger <bernd.edlinger@hotmail.de> 2016-06-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
* config/i386/i386.c (print_reg): Emit an error message on attempt to * config/i386/i386.c (print_reg): Emit an error message on attempt to
......
...@@ -3314,6 +3314,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, ...@@ -3314,6 +3314,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
set_mem_attributes (parmreg, parm, 1); set_mem_attributes (parmreg, parm, 1);
} }
/* We need to preserve an address based on VIRTUAL_STACK_VARS_REGNUM for
the debug info in case it is not legitimate. */
if (GET_MODE (parmreg) != GET_MODE (rtl)) if (GET_MODE (parmreg) != GET_MODE (rtl))
{ {
rtx tempreg = gen_reg_rtx (GET_MODE (rtl)); rtx tempreg = gen_reg_rtx (GET_MODE (rtl));
...@@ -3323,7 +3325,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, ...@@ -3323,7 +3325,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
all->last_conversion_insn); all->last_conversion_insn);
emit_move_insn (tempreg, rtl); emit_move_insn (tempreg, rtl);
tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p); tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p);
emit_move_insn (parmreg, tempreg); emit_move_insn (MEM_P (parmreg) ? copy_rtx (parmreg) : parmreg,
tempreg);
all->first_conversion_insn = get_insns (); all->first_conversion_insn = get_insns ();
all->last_conversion_insn = get_last_insn (); all->last_conversion_insn = get_last_insn ();
end_sequence (); end_sequence ();
...@@ -3331,7 +3334,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, ...@@ -3331,7 +3334,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true; did_conversion = true;
} }
else else
emit_move_insn (parmreg, rtl); emit_move_insn (MEM_P (parmreg) ? copy_rtx (parmreg) : parmreg, rtl);
rtl = parmreg; rtl = parmreg;
......
2016-06-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/guality/param-5.c: New test.
2016-06-22 Bernd Edlinger <bernd.edlinger@hotmail.de> 2016-06-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gcc.target/i386/asm-flag-7.c: New test. * gcc.target/i386/asm-flag-7.c: New test.
......
/* { dg-do run } */
/* { dg-options "-g" } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
typedef __UINTPTR_TYPE__ uintptr_t;
typedef struct { uintptr_t pa; uintptr_t pb; } fatp_t
__attribute__ ((aligned (2 * __alignof__ (uintptr_t))));
__attribute__((noinline, noclone)) void
clear_stack (void)
{
char a[128 * 1024 + 128];
__builtin_memset (a, 0, sizeof (a));
}
__attribute__((noinline, noclone)) void
foo (fatp_t str, int count)
{
char a[128 * 1024];
if (count > 0)
foo (str, count - 1);
clear_stack ();
count--; /* BREAK */
}
int
main (void)
{
fatp_t ptr = { 31415927, 27182818 };
foo (ptr, 1);
return 0;
}
/* { dg-final { gdb-test 26 "str.pa" "31415927" } } */
/* { dg-final { gdb-test 26 "str.pb" "27182818" } } */
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