Supporting accumulate outgoing arguments can reduce code size in functions that call functions which get their arguments on the stack more than once (statically).
Created attachment 25636 [details] aoa.c C source file that has several call to printf-ish function. With the current implementation, after each call the code must get rid of the pushed arguments which is expensive as SP cannot be modified directly. Compile with, e.g., $ avr-gcc aoa.c -S -Os -mmcu=avr4
Author: gjl Date: Sat Oct 29 14:35:59 2011 New Revision: 180654 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180654 Log: PR target/50887 * config/avr/avr.opt (-maccumulate-args): New option. * config/avr/avr.h (STARTING_FRAME_OFFSET): Redefine to avr_starting_frame_offset. (ACCUMULATE_OUTGOING_ARGS): Define to avr_accumulate_outgoing_args. * config/avr/avr.md (UNSPECV_WRITE_SP_IRQ_ON): Remove. (UNSPECV_WRITE_SP_IRQ_OFF): Remove. (UNSPECV_WRITE_SP): New constant. (*addhi3_sp_R): Rewrite to... (*addhi3_sp): ...this new insn. (movhi_sp_r_irq_off, movhi_sp_r_irq_on): Combine to... (movhi_sp_r): ...this new insn. * config/avr/avr-protos.h (avr_accumulate_outgoing_args): New. (avr_starting_frame_offset): New. * config/avr/avr.c (avr_accumulate_outgoing_args): New function. (avr_starting_frame_offset): New function. (avr_outgoing_args_size): New static function. (avr_initial_elimination_offset): Use it. (avr_simple_epilogue): Use it. (avr_asm_function_end_prologue): Use it. (expand_epilogue): Use it. (expand_prologue): Use it. Break out code to... (avr_prologue_setup_frame): ...this new static function. (avr_can_eliminate): Allow eliminating to frame pointer if there is one. (avr_frame_pointer_required_p): Use frame pointer if target has a nonlocal label. * config/avr/constraints.md (R): Remove. (Csp): New constraint. * config/avr/predicates.md (avr_sp_immediate_operand): Use it. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr-protos.h trunk/gcc/config/avr/avr.c trunk/gcc/config/avr/avr.h trunk/gcc/config/avr/avr.md trunk/gcc/config/avr/avr.opt trunk/gcc/config/avr/constraints.md trunk/gcc/config/avr/predicates.md
Author: gjl Date: Fri Jan 20 12:31:46 2012 New Revision: 183336 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183336 Log: PR target/49868 PR target/50887 * doc/extend.texi (Named Address Spaces): Split into subsections. (AVR Named Address Spaces): New subsection. (M32C Named Address Spaces): New subsection. (RL78 Named Address Spaces): New subsection. (SPU Named Address Spaces): New subsection. (Variable Attributes): New anchor "AVR Variable Attributes". (AVR Variable Attributes): Rewrite and avoid wording "address space" in this context. * doc/invoke.texi (AVR Options): Rewrite and add documentation for -maccumulate-args, -mbranch-cost=, -mrelax, -mshort-calls. (AVR Built-in Macros): New subsubsection therein. * doc/md.texi (AVR constraints): Remove "C04", "R". Modified: trunk/gcc/ChangeLog trunk/gcc/doc/extend.texi trunk/gcc/doc/invoke.texi trunk/gcc/doc/md.texi
Closed with its documentation