This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch,avr] Implement PR83737


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]