comparison gcc/config/avr/avr.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Subroutines for insn-output.c for ATMEL AVR micro controllers 1 /* Subroutines for insn-output.c for ATMEL AVR micro controllers
2 Copyright (C) 1998-2018 Free Software Foundation, Inc. 2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
3 Contributed by Denis Chertykov (chertykov@gmail.com) 3 Contributed by Denis Chertykov (chertykov@gmail.com)
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
49 #include "output.h" 49 #include "output.h"
50 #include "explow.h" 50 #include "explow.h"
51 #include "expr.h" 51 #include "expr.h"
52 #include "langhooks.h" 52 #include "langhooks.h"
53 #include "cfgrtl.h" 53 #include "cfgrtl.h"
54 #include "params.h"
55 #include "builtins.h" 54 #include "builtins.h"
56 #include "context.h" 55 #include "context.h"
57 #include "tree-pass.h" 56 #include "tree-pass.h"
58 #include "print-rtl.h" 57 #include "print-rtl.h"
59 #include "rtl-iter.h" 58 #include "rtl-iter.h"
739 perform the requested spills. */ 738 perform the requested spills. */
740 739
741 if (avr_strict_X) 740 if (avr_strict_X)
742 flag_caller_saves = 0; 741 flag_caller_saves = 0;
743 742
744 /* Allow optimizer to introduce store data races. This used to be the
745 default - it was changed because bigger targets did not see any
746 performance decrease. For the AVR though, disallowing data races
747 introduces additional code in LIM and increases reg pressure. */
748
749 maybe_set_param_value (PARAM_ALLOW_STORE_DATA_RACES, 1,
750 global_options.x_param_values,
751 global_options_set.x_param_values);
752
753 /* Unwind tables currently require a frame pointer for correctness, 743 /* Unwind tables currently require a frame pointer for correctness,
754 see toplev.c:process_options(). */ 744 see toplev.c:process_options(). */
755 745
756 if ((flag_unwind_tables 746 if ((flag_unwind_tables
757 || flag_non_call_exceptions 747 || flag_non_call_exceptions
760 { 750 {
761 flag_omit_frame_pointer = 0; 751 flag_omit_frame_pointer = 0;
762 } 752 }
763 753
764 if (flag_pic == 1) 754 if (flag_pic == 1)
765 warning (OPT_fpic, "-fpic is not supported"); 755 warning (OPT_fpic, "%<-fpic%> is not supported");
766 if (flag_pic == 2) 756 if (flag_pic == 2)
767 warning (OPT_fPIC, "-fPIC is not supported"); 757 warning (OPT_fPIC, "%<-fPIC%> is not supported");
768 if (flag_pie == 1) 758 if (flag_pie == 1)
769 warning (OPT_fpie, "-fpie is not supported"); 759 warning (OPT_fpie, "%<-fpie%> is not supported");
770 if (flag_pie == 2) 760 if (flag_pie == 2)
771 warning (OPT_fPIE, "-fPIE is not supported"); 761 warning (OPT_fPIE, "%<-fPIE%> is not supported");
772 762
773 #if !defined (HAVE_AS_AVR_MGCCISR_OPTION) 763 #if !defined (HAVE_AS_AVR_MGCCISR_OPTION)
774 avr_gasisr_prologues = 0; 764 avr_gasisr_prologues = 0;
775 #endif 765 #endif
776 766
777 if (!avr_set_core_architecture()) 767 if (!avr_set_core_architecture())
778 return; 768 return;
769
770 /* Sould be set by avr-common.c */
771 gcc_assert (avr_long_double >= avr_double && avr_double >= 32);
779 772
780 /* RAM addresses of some SFRs common to all devices in respective arch. */ 773 /* RAM addresses of some SFRs common to all devices in respective arch. */
781 774
782 /* SREG: Status Register containing flags like I (global IRQ) */ 775 /* SREG: Status Register containing flags like I (global IRQ) */
783 avr_addr.sreg = 0x3F + avr_arch->sfr_offset; 776 avr_addr.sreg = 0x3F + avr_arch->sfr_offset;
1181 any global register variables. */ 1174 any global register variables. */
1182 1175
1183 if (fixed_regs[reg]) 1176 if (fixed_regs[reg])
1184 continue; 1177 continue;
1185 1178
1186 if ((int_or_sig_p && !crtl->is_leaf && call_used_regs[reg]) 1179 if ((int_or_sig_p && !crtl->is_leaf && call_used_or_fixed_reg_p (reg))
1187 || (df_regs_ever_live_p (reg) 1180 || (df_regs_ever_live_p (reg)
1188 && (int_or_sig_p || !call_used_regs[reg]) 1181 && (int_or_sig_p || !call_used_or_fixed_reg_p (reg))
1189 /* Don't record frame pointer registers here. They are treated 1182 /* Don't record frame pointer registers here. They are treated
1190 indivitually in prologue. */ 1183 indivitually in prologue. */
1191 && !(frame_pointer_needed 1184 && !(frame_pointer_needed
1192 && (reg == REG_Y || reg == REG_Y + 1)))) 1185 && (reg == REG_Y || reg == REG_Y + 1))))
1193 { 1186 {
1300 1293
1301 return std_build_builtin_va_list (); 1294 return std_build_builtin_va_list ();
1302 } 1295 }
1303 1296
1304 1297
1305 /* Implement `TARGET_BUILTIN_SETJMP_FRAME_VALUE'. */
1306 /* Actual start of frame is virtual_stack_vars_rtx this is offset from
1307 frame pointer by +TARGET_STARTING_FRAME_OFFSET.
1308 Using saved frame = virtual_stack_vars_rtx - TARGET_STARTING_FRAME_OFFSET
1309 avoids creating add/sub of offset in nonlocal goto and setjmp. */
1310
1311 static rtx
1312 avr_builtin_setjmp_frame_value (void)
1313 {
1314 rtx xval = gen_reg_rtx (Pmode);
1315 emit_insn (gen_subhi3 (xval, virtual_stack_vars_rtx,
1316 gen_int_mode (avr_starting_frame_offset (), Pmode)));
1317 return xval;
1318 }
1319
1320
1321 /* Return contents of MEM at frame pointer + stack size + 1 (+2 if 3-byte PC). 1298 /* Return contents of MEM at frame pointer + stack size + 1 (+2 if 3-byte PC).
1322 This is return address of function. */ 1299 This is return address of function. */
1323 1300
1324 rtx 1301 rtx
1325 avr_return_addr_rtx (int count, rtx tem) 1302 avr_return_addr_rtx (int count, rtx tem)
1381 return 0; 1358 return 0;
1382 else 1359 else
1383 continue; 1360 continue;
1384 } 1361 }
1385 1362
1386 if (!call_used_regs[reg]) 1363 if (!call_used_or_fixed_reg_p (reg))
1387 { 1364 {
1388 if (df_regs_ever_live_p (reg)) 1365 if (df_regs_ever_live_p (reg))
1389 { 1366 {
1390 ++live_seq; 1367 ++live_seq;
1391 ++cur_seq; 1368 ++cur_seq;
3402 /* Implement `TARGET_FUNCTION_ARG'. */ 3379 /* Implement `TARGET_FUNCTION_ARG'. */
3403 /* Controls whether a function argument is passed 3380 /* Controls whether a function argument is passed
3404 in a register, and which register. */ 3381 in a register, and which register. */
3405 3382
3406 static rtx 3383 static rtx
3407 avr_function_arg (cumulative_args_t cum_v, machine_mode mode, 3384 avr_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
3408 const_tree type, bool named ATTRIBUTE_UNUSED)
3409 { 3385 {
3410 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); 3386 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
3411 int bytes = avr_num_arg_regs (mode, type); 3387 int bytes = avr_num_arg_regs (arg.mode, arg.type);
3412 3388
3413 if (cum->nregs && bytes <= cum->nregs) 3389 if (cum->nregs && bytes <= cum->nregs)
3414 return gen_rtx_REG (mode, cum->regno - bytes); 3390 return gen_rtx_REG (arg.mode, cum->regno - bytes);
3415 3391
3416 return NULL_RTX; 3392 return NULL_RTX;
3417 } 3393 }
3418 3394
3419 3395
3420 /* Implement `TARGET_FUNCTION_ARG_ADVANCE'. */ 3396 /* Implement `TARGET_FUNCTION_ARG_ADVANCE'. */
3421 /* Update the summarizer variable CUM to advance past an argument 3397 /* Update the summarizer variable CUM to advance past an argument
3422 in the argument list. */ 3398 in the argument list. */
3423 3399
3424 static void 3400 static void
3425 avr_function_arg_advance (cumulative_args_t cum_v, machine_mode mode, 3401 avr_function_arg_advance (cumulative_args_t cum_v,
3426 const_tree type, bool named ATTRIBUTE_UNUSED) 3402 const function_arg_info &arg)
3427 { 3403 {
3428 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); 3404 CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
3429 int bytes = avr_num_arg_regs (mode, type); 3405 int bytes = avr_num_arg_regs (arg.mode, arg.type);
3430 3406
3431 cum->nregs -= bytes; 3407 cum->nregs -= bytes;
3432 cum->regno -= bytes; 3408 cum->regno -= bytes;
3433 3409
3434 /* A parameter is being passed in a call-saved register. As the original 3410 /* A parameter is being passed in a call-saved register. As the original
3436 a function must not pass arguments in call-saved regs in order to get 3412 a function must not pass arguments in call-saved regs in order to get
3437 tail-called. */ 3413 tail-called. */
3438 3414
3439 if (cum->regno >= 8 3415 if (cum->regno >= 8
3440 && cum->nregs >= 0 3416 && cum->nregs >= 0
3441 && !call_used_regs[cum->regno]) 3417 && !call_used_or_fixed_reg_p (cum->regno))
3442 { 3418 {
3443 /* FIXME: We ship info on failing tail-call in struct machine_function. 3419 /* FIXME: We ship info on failing tail-call in struct machine_function.
3444 This uses internals of calls.c:expand_call() and the way args_so_far 3420 This uses internals of calls.c:expand_call() and the way args_so_far
3445 is used. targetm.function_ok_for_sibcall() needs to be extended to 3421 is used. targetm.function_ok_for_sibcall() needs to be extended to
3446 pass &args_so_far, too. At present, CUMULATIVE_ARGS is target 3422 pass &args_so_far, too. At present, CUMULATIVE_ARGS is target
3583 3559
3584 if (!df_regs_ever_live_p (regno) 3560 if (!df_regs_ever_live_p (regno)
3585 && (TREE_THIS_VOLATILE (current_function_decl) 3561 && (TREE_THIS_VOLATILE (current_function_decl)
3586 || cfun->machine->is_OS_task 3562 || cfun->machine->is_OS_task
3587 || cfun->machine->is_OS_main 3563 || cfun->machine->is_OS_main
3588 || (!isr_p && call_used_regs[regno]))) 3564 || (!isr_p && call_used_or_fixed_reg_p (regno))))
3589 { 3565 {
3590 return reg; 3566 return reg;
3591 } 3567 }
3592 3568
3593 /* Any live register can be used if it is unused after. 3569 /* Any live register can be used if it is unused after.
3795 { 3771 {
3796 default: 3772 default:
3797 gcc_unreachable(); 3773 gcc_unreachable();
3798 3774
3799 case 1: 3775 case 1:
3800 return avr_asm_len ("%4lpm %0,%a2", xop, plen, 1); 3776 avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
3777 break;
3801 3778
3802 case 2: 3779 case 2:
3803 if (REGNO (dest) == REG_Z) 3780 if (REGNO (dest) == REG_Z)
3804 return avr_asm_len ("%4lpm %5,%a2+" CR_TAB 3781 avr_asm_len ("%4lpm %5,%a2+" CR_TAB
3805 "%4lpm %B0,%a2" CR_TAB 3782 "%4lpm %B0,%a2" CR_TAB
3806 "mov %A0,%5", xop, plen, 3); 3783 "mov %A0,%5", xop, plen, 3);
3807 else 3784 else
3808 { 3785 {
3809 avr_asm_len ("%4lpm %A0,%a2+" CR_TAB 3786 avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
3810 "%4lpm %B0,%a2", xop, plen, 2); 3787 "%4lpm %B0,%a2", xop, plen, 2);
3811 3788
3830 3807
3831 avr_asm_len ("%4lpm %A0,%a2+" CR_TAB 3808 avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
3832 "%4lpm %B0,%a2+", xop, plen, 2); 3809 "%4lpm %B0,%a2+", xop, plen, 2);
3833 3810
3834 if (REGNO (dest) == REG_Z - 2) 3811 if (REGNO (dest) == REG_Z - 2)
3835 return avr_asm_len ("%4lpm %5,%a2+" CR_TAB 3812 avr_asm_len ("%4lpm %5,%a2+" CR_TAB
3836 "%4lpm %C0,%a2" CR_TAB 3813 "%4lpm %C0,%a2" CR_TAB
3837 "mov %D0,%5", xop, plen, 3); 3814 "mov %D0,%5", xop, plen, 3);
3838 else 3815 else
3839 { 3816 {
3840 avr_asm_len ("%4lpm %C0,%a2+" CR_TAB 3817 avr_asm_len ("%4lpm %C0,%a2+" CR_TAB
3841 "%4lpm %D0,%a2", xop, plen, 2); 3818 "%4lpm %D0,%a2", xop, plen, 2);
3842 3819
9418 9395
9419 case ADJUST_LEN_MOV8: output_movqi (insn, op, &len); break; 9396 case ADJUST_LEN_MOV8: output_movqi (insn, op, &len); break;
9420 case ADJUST_LEN_MOV16: output_movhi (insn, op, &len); break; 9397 case ADJUST_LEN_MOV16: output_movhi (insn, op, &len); break;
9421 case ADJUST_LEN_MOV24: avr_out_movpsi (insn, op, &len); break; 9398 case ADJUST_LEN_MOV24: avr_out_movpsi (insn, op, &len); break;
9422 case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break; 9399 case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
9423 case ADJUST_LEN_MOVMEM: avr_out_movmem (insn, op, &len); break; 9400 case ADJUST_LEN_CPYMEM: avr_out_cpymem (insn, op, &len); break;
9424 case ADJUST_LEN_XLOAD: avr_out_xload (insn, op, &len); break; 9401 case ADJUST_LEN_XLOAD: avr_out_xload (insn, op, &len); break;
9425 case ADJUST_LEN_SEXT: avr_out_sign_extend (insn, op, &len); break; 9402 case ADJUST_LEN_SEXT: avr_out_sign_extend (insn, op, &len); break;
9426 9403
9427 case ADJUST_LEN_SFRACT: avr_out_fract (insn, op, true, &len); break; 9404 case ADJUST_LEN_SFRACT: avr_out_fract (insn, op, true, &len); break;
9428 case ADJUST_LEN_UFRACT: avr_out_fract (insn, op, false, &len); break; 9405 case ADJUST_LEN_UFRACT: avr_out_fract (insn, op, false, &len); break;
9567 for (tem = CALL_INSN_FUNCTION_USAGE (insn); tem; tem = XEXP (tem, 1)) 9544 for (tem = CALL_INSN_FUNCTION_USAGE (insn); tem; tem = XEXP (tem, 1))
9568 if (GET_CODE (XEXP (tem, 0)) == USE 9545 if (GET_CODE (XEXP (tem, 0)) == USE
9569 && REG_P (XEXP (XEXP (tem, 0), 0)) 9546 && REG_P (XEXP (XEXP (tem, 0), 0))
9570 && reg_overlap_mentioned_p (reg, XEXP (XEXP (tem, 0), 0))) 9547 && reg_overlap_mentioned_p (reg, XEXP (XEXP (tem, 0), 0)))
9571 return 0; 9548 return 0;
9572 if (call_used_regs[REGNO (reg)]) 9549 if (call_used_or_fixed_reg_p (REGNO (reg)))
9573 return 1; 9550 return 1;
9574 } 9551 }
9575 9552
9576 set = single_set (insn); 9553 set = single_set (insn);
9577 9554
10177 error_at (DECL_SOURCE_LOCATION (decl), 10154 error_at (DECL_SOURCE_LOCATION (decl),
10178 "static IO declaration for %q+D needs an address", decl); 10155 "static IO declaration for %q+D needs an address", decl);
10179 return; 10156 return;
10180 } 10157 }
10181 10158
10182 /* __gnu_lto_v1 etc. are just markers for the linker injected by toplev.c. 10159 /* __gnu_lto_slim is just a marker for the linker injected by toplev.c.
10183 There is no need to trigger __do_clear_bss code for them. */ 10160 There is no need to trigger __do_clear_bss code for them. */
10184 10161
10185 if (!STR_PREFIX_P (name, "__gnu_lto")) 10162 if (!STR_PREFIX_P (name, "__gnu_lto"))
10186 avr_need_clear_bss_p = true; 10163 avr_need_clear_bss_p = true;
10187 10164
12179 12156
12180 12157
12181 /* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ 12158 /* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */
12182 12159
12183 static bool 12160 static bool
12184 avr_hard_regno_call_part_clobbered (unsigned regno, machine_mode mode) 12161 avr_hard_regno_call_part_clobbered (unsigned, unsigned regno,
12162 machine_mode mode)
12185 { 12163 {
12186 /* FIXME: This hook gets called with MODE:REGNO combinations that don't 12164 /* FIXME: This hook gets called with MODE:REGNO combinations that don't
12187 represent valid hard registers like, e.g. HI:29. Returning TRUE 12165 represent valid hard registers like, e.g. HI:29. Returning TRUE
12188 for such registers can lead to performance degradation as mentioned 12166 for such registers can lead to performance degradation as mentioned
12189 in PR53595. Thus, report invalid hard registers as FALSE. */ 12167 in PR53595. Thus, report invalid hard registers as FALSE. */
13334 13312
13335 return avr_move_fixed_operands (op, hreg, opmask); 13313 return avr_move_fixed_operands (op, hreg, opmask);
13336 } 13314 }
13337 13315
13338 13316
13339 /* Worker function for movmemhi expander. 13317 /* Worker function for cpymemhi expander.
13340 XOP[0] Destination as MEM:BLK 13318 XOP[0] Destination as MEM:BLK
13341 XOP[1] Source " " 13319 XOP[1] Source " "
13342 XOP[2] # Bytes to copy 13320 XOP[2] # Bytes to copy
13343 13321
13344 Return TRUE if the expansion is accomplished. 13322 Return TRUE if the expansion is accomplished.
13345 Return FALSE if the operand compination is not supported. */ 13323 Return FALSE if the operand compination is not supported. */
13346 13324
13347 bool 13325 bool
13348 avr_emit_movmemhi (rtx *xop) 13326 avr_emit_cpymemhi (rtx *xop)
13349 { 13327 {
13350 HOST_WIDE_INT count; 13328 HOST_WIDE_INT count;
13351 machine_mode loop_mode; 13329 machine_mode loop_mode;
13352 addr_space_t as = MEM_ADDR_SPACE (xop[1]); 13330 addr_space_t as = MEM_ADDR_SPACE (xop[1]);
13353 rtx loop_reg, addr1, a_src, a_dest, insn, xas; 13331 rtx loop_reg, addr1, a_src, a_dest, insn, xas;
13420 { 13398 {
13421 /* Load instruction ([E]LPM or LD) is known at compile time: 13399 /* Load instruction ([E]LPM or LD) is known at compile time:
13422 Do the copy-loop inline. */ 13400 Do the copy-loop inline. */
13423 13401
13424 rtx (*fun) (rtx, rtx, rtx) 13402 rtx (*fun) (rtx, rtx, rtx)
13425 = QImode == loop_mode ? gen_movmem_qi : gen_movmem_hi; 13403 = QImode == loop_mode ? gen_cpymem_qi : gen_cpymem_hi;
13426 13404
13427 insn = fun (xas, loop_reg, loop_reg); 13405 insn = fun (xas, loop_reg, loop_reg);
13428 } 13406 }
13429 else 13407 else
13430 { 13408 {
13431 rtx (*fun) (rtx, rtx) 13409 rtx (*fun) (rtx, rtx)
13432 = QImode == loop_mode ? gen_movmemx_qi : gen_movmemx_hi; 13410 = QImode == loop_mode ? gen_cpymemx_qi : gen_cpymemx_hi;
13433 13411
13434 emit_move_insn (gen_rtx_REG (QImode, 23), a_hi8); 13412 emit_move_insn (gen_rtx_REG (QImode, 23), a_hi8);
13435 13413
13436 insn = fun (xas, GEN_INT (avr_addr.rampz)); 13414 insn = fun (xas, GEN_INT (avr_addr.rampz));
13437 } 13415 }
13441 13419
13442 return true; 13420 return true;
13443 } 13421 }
13444 13422
13445 13423
13446 /* Print assembler for movmem_qi, movmem_hi insns... 13424 /* Print assembler for cpymem_qi, cpymem_hi insns...
13447 $0 : Address Space 13425 $0 : Address Space
13448 $1, $2 : Loop register 13426 $1, $2 : Loop register
13449 Z : Source address 13427 Z : Source address
13450 X : Destination address 13428 X : Destination address
13451 */ 13429 */
13452 13430
13453 const char* 13431 const char*
13454 avr_out_movmem (rtx_insn *insn ATTRIBUTE_UNUSED, rtx *op, int *plen) 13432 avr_out_cpymem (rtx_insn *insn ATTRIBUTE_UNUSED, rtx *op, int *plen)
13455 { 13433 {
13456 addr_space_t as = (addr_space_t) INTVAL (op[0]); 13434 addr_space_t as = (addr_space_t) INTVAL (op[0]);
13457 machine_mode loop_mode = GET_MODE (op[1]); 13435 machine_mode loop_mode = GET_MODE (op[1]);
13458 bool sbiw_p = test_hard_reg_class (ADDW_REGS, op[1]); 13436 bool sbiw_p = test_hard_reg_class (ADDW_REGS, op[1]);
13459 rtx xop[3]; 13437 rtx xop[3];
14256 machine_mode mode ATTRIBUTE_UNUSED, 14234 machine_mode mode ATTRIBUTE_UNUSED,
14257 int ignore) 14235 int ignore)
14258 { 14236 {
14259 tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0); 14237 tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
14260 const char *bname = IDENTIFIER_POINTER (DECL_NAME (fndecl)); 14238 const char *bname = IDENTIFIER_POINTER (DECL_NAME (fndecl));
14261 unsigned int id = DECL_FUNCTION_CODE (fndecl); 14239 unsigned int id = DECL_MD_FUNCTION_CODE (fndecl);
14262 const struct avr_builtin_description *d = &avr_bdesc[id]; 14240 const struct avr_builtin_description *d = &avr_bdesc[id];
14263 tree arg0; 14241 tree arg0;
14264 rtx op0; 14242 rtx op0;
14265 14243
14266 gcc_assert (id < AVR_BUILTIN_COUNT); 14244 gcc_assert (id < AVR_BUILTIN_COUNT);
14408 14386
14409 static tree 14387 static tree
14410 avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, 14388 avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
14411 bool ignore ATTRIBUTE_UNUSED) 14389 bool ignore ATTRIBUTE_UNUSED)
14412 { 14390 {
14413 unsigned int fcode = DECL_FUNCTION_CODE (fndecl); 14391 unsigned int fcode = DECL_MD_FUNCTION_CODE (fndecl);
14414 tree val_type = TREE_TYPE (TREE_TYPE (fndecl)); 14392 tree val_type = TREE_TYPE (TREE_TYPE (fndecl));
14415 14393
14416 if (!optimize) 14394 if (!optimize)
14417 return NULL_TREE; 14395 return NULL_TREE;
14418 14396
14593 return build_call_expr (fndecl, 3, tmap, tbits, tval); 14571 return build_call_expr (fndecl, 3, tmap, tbits, tval);
14594 } /* AVR_BUILTIN_INSERT_BITS */ 14572 } /* AVR_BUILTIN_INSERT_BITS */
14595 } 14573 }
14596 14574
14597 return NULL_TREE; 14575 return NULL_TREE;
14576 }
14577
14578
14579 /* Worker function for `FLOAT_LIB_COMPARE_RETURNS_BOOL'. */
14580
14581 bool
14582 avr_float_lib_compare_returns_bool (machine_mode mode, enum rtx_code)
14583 {
14584 if (mode == DFmode)
14585 {
14586 #if WITH_DOUBLE_COMPARISON == 2
14587 return true;
14588 #endif
14589 }
14590
14591 // This is the GCC default and also what AVR-LibC implements.
14592 return false;
14598 } 14593 }
14599 14594
14600 14595
14601 14596
14602 /* Initialize the GCC target structure. */ 14597 /* Initialize the GCC target structure. */
14669 #define TARGET_RETURN_IN_MEMORY avr_return_in_memory 14664 #define TARGET_RETURN_IN_MEMORY avr_return_in_memory
14670 14665
14671 #undef TARGET_STRICT_ARGUMENT_NAMING 14666 #undef TARGET_STRICT_ARGUMENT_NAMING
14672 #define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true 14667 #define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
14673 14668
14674 #undef TARGET_BUILTIN_SETJMP_FRAME_VALUE
14675 #define TARGET_BUILTIN_SETJMP_FRAME_VALUE avr_builtin_setjmp_frame_value
14676
14677 #undef TARGET_CONDITIONAL_REGISTER_USAGE 14669 #undef TARGET_CONDITIONAL_REGISTER_USAGE
14678 #define TARGET_CONDITIONAL_REGISTER_USAGE avr_conditional_register_usage 14670 #define TARGET_CONDITIONAL_REGISTER_USAGE avr_conditional_register_usage
14679 14671
14680 #undef TARGET_HARD_REGNO_MODE_OK 14672 #undef TARGET_HARD_REGNO_MODE_OK
14681 #define TARGET_HARD_REGNO_MODE_OK avr_hard_regno_mode_ok 14673 #define TARGET_HARD_REGNO_MODE_OK avr_hard_regno_mode_ok