avr.c (avr_case_values_threshold): New.
* config/avr/avr.c (avr_case_values_threshold): New. (avr_override_options): Set it depending on options, make it large when not optimizing to work around "unable to generate reloads". * config/avr/avr.h (TARGET_SWITCHES): Add -mno-tablejump option. (EXTRA_SECTION_FUNCTIONS): Make the .progmem.gcc_sw_table section executable if not AVR_MEGA. Make sure jump tables are word-aligned. (JUMP_TABLES_IN_TEXT_SECTION): Define as 0, not 1. (ASM_OUTPUT_ADDR_VEC_ELT): Optimize, use "rjmp" if not AVR_MEGA. (avr_case_values_threshold): Declare as extern int. (CASE_VALUES_THRESHOLD): Define as avr_case_values_threshold. * config/avr/avr.md (tablejump): Removed. (*tablejump_rjmp): New for jump tables made from "rjmp" instructions. (*tablejump_lib, *tablejump_enh, *tablejump): Change to expect the index in the table, not multiplied by 2. (casesi): Change to match the above insns. Always enable. * config/avr/libgcc.S (__tablejump__): Rename to __tablejump2__. Change to expect the word address of the table, multiply it by 2 here and not in the caller. Change "adiw" to faster "inc". From-SVN: r37465
Showing
Please
register
or
sign in
to comment