mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 15:40:55 +08:00
sh.c (output_stack_adjust): Add new argument frame_p.
* config/sh/sh.c (output_stack_adjust): Add new argument frame_p. (sh_expand_prologue): Update calls to output_stack_adjust. (sh_expand_epilogue): Likewise. * gcc.target/sh/struct-arg-dw2.c: New test. Co-Authored-By: Kaz Kojima <kkojima@gcc.gnu.org> From-SVN: r151735
This commit is contained in:
parent
41b7d41764
commit
21d0569488
@ -1,3 +1,10 @@
|
||||
2009-09-16 DJ Delorie <dj@redhat.com>
|
||||
Kaz Kojima <kkojima@gcc.gnu.org>
|
||||
|
||||
* config/sh/sh.c (output_stack_adjust): Add new argument frame_p.
|
||||
(sh_expand_prologue): Update calls to output_stack_adjust.
|
||||
(sh_expand_epilogue): Likewise.
|
||||
|
||||
2009-09-15 Adam Nemet <anemet@caviumnetworks.com>
|
||||
|
||||
PR bootstrap/41349
|
||||
|
@ -177,7 +177,7 @@ static rtx find_barrier (int, rtx, rtx);
|
||||
static int noncall_uses_reg (rtx, rtx, rtx *);
|
||||
static rtx gen_block_redirect (rtx, int, int);
|
||||
static void sh_reorg (void);
|
||||
static void output_stack_adjust (int, rtx, int, HARD_REG_SET *);
|
||||
static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
|
||||
static rtx frame_insn (rtx);
|
||||
static rtx push (int);
|
||||
static void pop (int);
|
||||
@ -6037,9 +6037,9 @@ output_jump_label_table (void)
|
||||
|
||||
static void
|
||||
output_stack_adjust (int size, rtx reg, int epilogue_p,
|
||||
HARD_REG_SET *live_regs_mask)
|
||||
HARD_REG_SET *live_regs_mask, bool frame_p)
|
||||
{
|
||||
rtx (*emit_fn) (rtx) = epilogue_p ? &emit_insn : &frame_insn;
|
||||
rtx (*emit_fn) (rtx) = frame_p ? &frame_insn : &emit_insn;
|
||||
if (size)
|
||||
{
|
||||
HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
|
||||
@ -6701,9 +6701,10 @@ sh_expand_prologue (void)
|
||||
&& (NPARM_REGS(SImode)
|
||||
> crtl->args.info.arg_count[(int) SH_ARG_INT]))
|
||||
pretend_args = 0;
|
||||
/* Dwarf2 module doesn't expect frame related insns here. */
|
||||
output_stack_adjust (-pretend_args
|
||||
- crtl->args.info.stack_regs * 8,
|
||||
stack_pointer_rtx, 0, NULL);
|
||||
stack_pointer_rtx, 0, NULL, false);
|
||||
|
||||
if (TARGET_SHCOMPACT && flag_pic && crtl->args.info.call_cookie)
|
||||
/* We're going to use the PIC register to load the address of the
|
||||
@ -6834,7 +6835,7 @@ sh_expand_prologue (void)
|
||||
offset_base = d + d_rounding;
|
||||
|
||||
output_stack_adjust (-(save_size + d_rounding), stack_pointer_rtx,
|
||||
0, NULL);
|
||||
0, NULL, true);
|
||||
|
||||
sh5_schedule_saves (&live_regs_mask, &schedule, offset_base);
|
||||
tmp_pnt = schedule.temps;
|
||||
@ -7009,7 +7010,7 @@ sh_expand_prologue (void)
|
||||
target_flags = save_flags;
|
||||
|
||||
output_stack_adjust (-rounded_frame_size (d) + d_rounding,
|
||||
stack_pointer_rtx, 0, NULL);
|
||||
stack_pointer_rtx, 0, NULL, true);
|
||||
|
||||
if (frame_pointer_needed)
|
||||
frame_insn (GEN_MOV (hard_frame_pointer_rtx, stack_pointer_rtx));
|
||||
@ -7074,7 +7075,7 @@ sh_expand_epilogue (bool sibcall_p)
|
||||
See PR/18032 and PR/40313. */
|
||||
emit_insn (gen_blockage ());
|
||||
output_stack_adjust (frame_size, hard_frame_pointer_rtx, e,
|
||||
&live_regs_mask);
|
||||
&live_regs_mask, false);
|
||||
|
||||
/* We must avoid moving the stack pointer adjustment past code
|
||||
which reads from the local frame, else an interrupt could
|
||||
@ -7090,7 +7091,8 @@ sh_expand_epilogue (bool sibcall_p)
|
||||
occur after the SP adjustment and clobber data in the local
|
||||
frame. */
|
||||
emit_insn (gen_blockage ());
|
||||
output_stack_adjust (frame_size, stack_pointer_rtx, e, &live_regs_mask);
|
||||
output_stack_adjust (frame_size, stack_pointer_rtx, e,
|
||||
&live_regs_mask, false);
|
||||
}
|
||||
|
||||
if (SHMEDIA_REGS_STACK_ADJUST ())
|
||||
@ -7277,7 +7279,7 @@ sh_expand_epilogue (bool sibcall_p)
|
||||
output_stack_adjust (crtl->args.pretend_args_size
|
||||
+ save_size + d_rounding
|
||||
+ crtl->args.info.stack_regs * 8,
|
||||
stack_pointer_rtx, e, NULL);
|
||||
stack_pointer_rtx, e, NULL, false);
|
||||
|
||||
if (crtl->calls_eh_return)
|
||||
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-09-16 DJ Delorie <dj@redhat.com>
|
||||
Kaz Kojima <kkojima@gcc.gnu.org>
|
||||
|
||||
* gcc.target/sh/struct-arg-dw2.c: New test.
|
||||
|
||||
2009-09-15 Nathan Froyd <froydnj@codesourcery.com>
|
||||
Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
|
26
gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
Normal file
26
gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
Normal file
@ -0,0 +1,26 @@
|
||||
/* Verify that we don't generate fame related insn against stack adjustment
|
||||
for the object sent partially in registers. */
|
||||
/* { dg-do compile { target "sh*-*-*" } } */
|
||||
/* { dg-options "-g" } */
|
||||
/* { dg-final { scan-assembler-not "\t.cfi_def_cfa_offset 16" } } */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short A1;
|
||||
unsigned short A2;
|
||||
} A_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
A_t C13[10];
|
||||
} C_t;
|
||||
|
||||
void
|
||||
Store (C_t Par)
|
||||
{
|
||||
unsigned char *ptr;
|
||||
unsigned int test;
|
||||
|
||||
ptr = (unsigned char*) 0x12345678;
|
||||
ptr++;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user