--- gcc/config/arm.c 2018/04/24 17:51:37 1.1 +++ gcc/config/arm.c 2018/04/24 18:06:04 1.1.1.3 @@ -20,7 +20,7 @@ along with GNU CC; see the file COPYING. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include "assert.h" #include "config.h" #include "rtl.h" #include "regs.h" @@ -38,7 +38,6 @@ the Free Software Foundation, 675 Mass A #define MAX_INSNS_SKIPPED 5 /* Some function declarations. */ -extern void *xmalloc (); extern FILE *asm_out_file; extern char *output_multi_immediate (); extern char *arm_output_asm_insn (); @@ -170,7 +169,7 @@ power_of_two_operand (op, mode) } /* power_of_two_operand */ /* Return TRUE for a valid operand of a DImode operation. - Either: REG, CONST_DOUBLE or MEM(offsetable). + Either: REG, CONST_DOUBLE or MEM(offsettable). Note that this disallows MEM(REG+REG). */ int @@ -332,7 +331,7 @@ output_mov_double_arm_from_fpu (operands /* Output a move between double words. It must be REG<-REG, REG<-CONST_DOUBLE, REG<-CONST_INT, REG<-MEM - or MEM<-REG and all MEMs must be offsetable addresses. */ + or MEM<-REG and all MEMs must be offsettable addresses. */ char * output_move_double (operands) @@ -393,7 +392,7 @@ output_move_double (operands) else { otherops[1] = adj_offsettable_operand (operands[1], 4); - /* Take care of overlaping base/data reg. */ + /* Take care of overlapping base/data reg. */ if (reg_mentioned_p (operands[0], operands[1])) { arm_output_asm_insn ("ldr\t%0, %1", otherops); @@ -919,6 +918,14 @@ output_epilogue (f, frame_size) } else { + /* Restore stack pointer if necessary. */ + if (frame_size) + { + operands[0] = operands[1] = stack_pointer_rtx; + operands[2] = gen_rtx (CONST_INT, VOIDmode, frame_size); + output_add_immediate (operands); + } + if (current_function_pretend_args_size == 0 && regs_ever_live[14]) { print_multi_reg (f, "ldmfd\tsp!", @@ -1012,7 +1019,7 @@ arm_asm_output_label (stream, name) for (s = real_name; *s; s++) hash += *s; hash = hash % LABEL_HASH_SIZE; - cur = xmalloc (sizeof (struct label_offset)); + cur = (struct label_offset *) xmalloc (sizeof (struct label_offset)); cur->name = real_name; cur->offset = arm_text_location; cur->cdr = offset_table[hash]; @@ -1084,7 +1091,7 @@ arm_output_llc (operands) directive hence this hack, which works by reserving some `.space' in the bss segment directly. - XXX This is a severe hack, which is garanteed NOT to work since it doesn't + XXX This is a severe hack, which is guaranteed NOT to work since it doesn't define STATIC COMMON space but merely STATIC BSS space. */ void @@ -1103,7 +1110,7 @@ output_lcomm_directive (stream, name, si } /* output_lcomm_directive */ /* A finite state machine takes care of noticing whether or not instructions - can be conditionaly executed, and thus decrease execution time and code + can be conditionally executed, and thus decrease execution time and code size by deleting branch instructions. The fsm is controlled by final_prescan_insn, and controls the actions of ASM_OUTPUT_OPCODE. */