aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-06-06 10:45:16 -0700
committerJim Wilson <wilson@gcc.gnu.org>1995-06-06 10:45:16 -0700
commit79b2746ad73c6159b77a510032162c09ebfb1613 (patch)
tree8c56ddb9b063de72e1e8a0150b0cebc3bcd525a3 /gcc
parent60715d0bef40ecaebd6753e865173648a20a1306 (diff)
downloadgcc-79b2746ad73c6159b77a510032162c09ebfb1613.zip
gcc-79b2746ad73c6159b77a510032162c09ebfb1613.tar.gz
gcc-79b2746ad73c6159b77a510032162c09ebfb1613.tar.bz2
(print_operand): Check for annulled branches.
(output_movedouble): Handle SUBREG addresses. (output_branch): Handle annulled branches. (sh_expand_prologue): Correct number of saved registers for varargs functions. From-SVN: r9886
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sh/sh.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 69b0b8f..77d44ef 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -163,7 +163,8 @@ print_operand (stream, x, code)
switch (code)
{
case '.':
- if (final_sequence)
+ if (final_sequence
+ && ! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
fprintf (stream, ".s");
break;
case '@':
@@ -428,6 +429,8 @@ output_movedouble (insn, operands, mode)
if (GET_CODE (inside) == REG)
ptrreg = REGNO (inside);
+ else if (GET_CODE (inside) == SUBREG)
+ ptrreg = REGNO (SUBREG_REG (inside)) + SUBREG_WORD (inside);
else if (GET_CODE (inside) == PLUS)
{
ptrreg = REGNO (XEXP (inside, 0));
@@ -530,11 +533,17 @@ output_branch (logic, insn, operands)
/* The call to print_slot will clobber the operands. */
rtx op0 = operands[0];
+ /* If the instruction in the delay slot is annulled (true), then
+ there is no delay slot where we can put it now. The only safe
+ place for it is after the label. */
+
if (final_sequence)
{
- fprintf (asm_out_file, "\tb%c.s\tLF%d\n", logic ? 'f' : 't',
- label);
- print_slot (final_sequence);
+ fprintf (asm_out_file, "\tb%c%s\tLF%d\n", logic ? 'f' : 't',
+ INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0))
+ ? "" : ".s", label);
+ if (! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
+ print_slot (final_sequence);
}
else
fprintf (asm_out_file, "\tb%c\tLF%d\n", logic ? 'f' : 't', label);
@@ -542,6 +551,10 @@ output_branch (logic, insn, operands)
output_asm_insn ("bra %l0", &op0);
fprintf (asm_out_file, "\tnop\n");
fprintf (asm_out_file, "LF%d:\n", label);
+
+ if (final_sequence
+ && INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
+ print_slot (final_sequence);
}
return "";
@@ -553,19 +566,29 @@ output_branch (logic, insn, operands)
/* The call to print_slot will clobber the operands. */
rtx op0 = operands[0];
+ /* If the instruction in the delay slot is annulled (true), then
+ there is no delay slot where we can put it now. The only safe
+ place for it is after the label. */
+
if (final_sequence)
{
- fprintf (asm_out_file, "\tb%c.s\tLF%d\n", logic ? 'f' : 't',
- label);
- print_slot (final_sequence);
+ fprintf (asm_out_file, "\tb%c%s\tLF%d\n", logic ? 'f' : 't',
+ INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0))
+ ? "" : ".s", label);
+ if (! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
+ print_slot (final_sequence);
}
else
fprintf (asm_out_file, "\tb%c\tLF%d\n", logic ? 'f' : 't', label);
output_far_jump (insn, op0);
fprintf (asm_out_file, "LF%d:\n", label);
- return "";
+
+ if (final_sequence
+ && INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
+ print_slot (final_sequence);
}
+ return "";
}
return "bad";
}
@@ -1520,7 +1543,8 @@ sh_expand_prologue ()
for (i = 0; i < NPARM_REGS; i++)
{
int rn = NPARM_REGS + FIRST_PARM_REG - i - 1;
- if (i > NPARM_REGS - current_function_args_info)
+ if (i > (NPARM_REGS - current_function_args_info
+ - current_function_varargs))
break;
push (rn);
extra_push += 4;