AVR: target 113927 - Simple code triggers stack frame for Reduced Tiny.
The -mmcu=avrtiny cores have no ADIW and SBIW instructions. This was implemented by clearing all regs out of regclass ADDW_REGS so that constraint "w" never matched. This corrupted the subset relations of the register classes as they appear in enum reg_class. This patch keeps ADDW_REGS like for all other cores, i.e. it contains R24...R31. Instead of tests like test_hard_reg_class (ADDW_REGS, *) the code now uses avr_adiw_reg_p (*). And all insns with constraint "w" get "isa" insn attribute value of "adiw". Plus, a new built-in macro __AVR_HAVE_ADIW__ is provided, which is more specific than __AVR_TINY__. gcc/ PR target/113927 * config/avr/avr.h (AVR_HAVE_ADIW): New macro. * config/avr/avr-protos.h (avr_adiw_reg_p): New proto. * config/avr/avr.cc (avr_adiw_reg_p): New function. (avr_conditional_register_usage) [AVR_TINY]: Don't clear ADDW_REGS. Replace test_hard_reg_class (ADDW_REGS, ...) with calls to * config/avr/avr.md: Same. (attr "isa") <tiny, no_tiny>: Remove. <adiw, no_adiw>: Add. (define_insn, define_insn_and_split): When an alternative has constraint "w", then set attribute "isa" to "adiw". * config/avr/avr-c.cc (avr_cpu_cpp_builtins) [AVR_HAVE_ADIW]: Built-in define __AVR_HAVE_ADIW__. * doc/invoke.texi (AVR Options): Document it.
Showing
- gcc/config/avr/avr-c.cc 1 addition, 0 deletionsgcc/config/avr/avr-c.cc
- gcc/config/avr/avr-protos.h 1 addition, 0 deletionsgcc/config/avr/avr-protos.h
- gcc/config/avr/avr.cc 16 additions, 6 deletionsgcc/config/avr/avr.cc
- gcc/config/avr/avr.h 1 addition, 0 deletionsgcc/config/avr/avr.h
- gcc/config/avr/avr.md 29 additions, 18 deletionsgcc/config/avr/avr.md
- gcc/doc/invoke.texi 7 additions, 4 deletionsgcc/doc/invoke.texi
Loading
Please register or sign in to comment