This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,avr] Implement PR83737
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 8 Jan 2018 21:39:39 +0400
- Subject: Re: [patch,avr] Implement PR83737
- Authentication-results: sourceware.org; auth=none
- References: <ea5ce349-0189-b7e3-0355-ed50b21d5cbb@gjlay.de>
2018-01-08 20:19 GMT+04:00 Georg-Johann Lay <avr@gjlay.de>:
> This PR skips saving of any registers in main.
>
> Attribute OS_main can do this as well, however we can just drop
> any saves / restores in all optimized compilation -- not even
> the test suite needs these saves.
>
> The feature can still be switched off by new -mno-OS_main
>
> Ok for trunk?
I like it.
Please commit.
>
>
> gcc/
> Don't save registers in main().
>
> PR target/83737
> * doc/invoke.texi (AVR Options) [-mOS_main]: Document it.
> * config/avr/avr.opt (-mOS_main): New target option.
> * config/avr/avr.c (avr_in_main_p): New static function.
> (avr_regs_to_save) [avr_in_main_p]: Return 0.
> (avr_prologue_setup_frame): Don't save any regs if avr_in_main_p.
> (avr_expand_epilogue): Same.
> * common/config/avr/avr-common.c (avr_option_optimization_table):
> Switch on -mOS_main for optimizing compilations.