diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2023-05-23 14:54:12 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2023-05-25 19:38:54 +0200 |
commit | 66cc0cb0f44f17049f61af6755043999c4fa5a24 (patch) | |
tree | 39911c41b17183513c7b1db251b7b1e04b398765 /gcc/config/avr/avr.cc | |
parent | ff0a6900700636ac4c7f40b88490a20d19a68db3 (diff) | |
download | gcc-66cc0cb0f44f17049f61af6755043999c4fa5a24.zip gcc-66cc0cb0f44f17049f61af6755043999c4fa5a24.tar.gz gcc-66cc0cb0f44f17049f61af6755043999c4fa5a24.tar.bz2 |
target/104327: Allow more inlining between different optimization levels.
avr-common.cc introduces the following options that are set depending
on optimization level: -mgas-isr-prologues, -mmain-is-OS-task and
-fsplit-wide-types-early. The inliner thinks that different options
disallow cross-optimization inlining, so provide can_inline_p.
gcc/
PR target/104327
* config/avr/avr.cc (avr_can_inline_p): New static function.
(TARGET_CAN_INLINE_P): Define to that function.
Diffstat (limited to 'gcc/config/avr/avr.cc')
-rw-r--r-- | gcc/config/avr/avr.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 3170696..a90cade 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -1018,6 +1018,19 @@ avr_no_gccisr_function_p (tree func) return avr_lookup_function_attribute1 (func, "no_gccisr"); } + +/* Implement `TARGET_CAN_INLINE_P'. */ +/* Some options like -mgas_isr_prologues depend on optimization level, + and the inliner might think that due to different options, inlining + is not permitted; see PR104327. */ + +static bool +avr_can_inline_p (tree /* caller */, tree /* callee */) +{ + // No restrictions whatsoever. + return true; +} + /* Implement `TARGET_SET_CURRENT_FUNCTION'. */ /* Sanity cheching for above function attributes. */ @@ -14770,6 +14783,9 @@ avr_float_lib_compare_returns_bool (machine_mode mode, enum rtx_code) #undef TARGET_MD_ASM_ADJUST #define TARGET_MD_ASM_ADJUST avr_md_asm_adjust +#undef TARGET_CAN_INLINE_P +#define TARGET_CAN_INLINE_P avr_can_inline_p + struct gcc_target targetm = TARGET_INITIALIZER; |