Lines Matching refs:rtl
63 #include "rtl.h"
87 #include "print-rtl.h"
96 #include "rtl-iter.h"
1353 rtx GTY ((tag ("0"))) rtl;
4315 /* Test if rtl node points to a pseudo register. */
4318 is_pseudo_reg (const_rtx rtl)
4320 return ((REG_P (rtl) && REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
4321 || (GET_CODE (rtl) == SUBREG
4322 && REGNO (SUBREG_REG (rtl)) >= FIRST_PSEUDO_REGISTER));
5101 inchash::add_rtx (a->addr.rtl, hstate);
5116 return rtx_equal_p (a1->addr.rtl, a2->addr.rtl);
5134 e->addr.rtl = (rtx) addr;
14219 /* Return the DBX register number described by a given RTL node. */
14222 dbx_reg_number (const_rtx rtl)
14224 unsigned regno = REGNO (rtl);
14266 reg_loc_descriptor (rtx rtl, enum var_init_status initialized)
14270 if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
14278 if ((rtl == arg_pointer_rtx || rtl == frame_pointer_rtx)
14279 && eliminate_regs (rtl, VOIDmode, NULL_RTX) != rtl)
14285 result = mem_loc_descriptor (rtl, GET_MODE (rtl), VOIDmode,
14294 regs = targetm.dwarf_register_span (rtl);
14296 if (REG_NREGS (rtl) > 1 || regs)
14297 return multiple_reg_loc_descriptor (rtl, regs, initialized);
14300 unsigned int dbx_regnum = dbx_reg_number (rtl);
14327 /* Given an RTL of a register, return a location descriptor that
14331 multiple_reg_loc_descriptor (rtx rtl, rtx regs,
14340 unsigned reg = REGNO (rtl);
14352 gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
14353 nregs = REG_NREGS (rtl);
14356 if (!GET_MODE_SIZE (GET_MODE (rtl)).is_constant (&size))
14918 /* Return true if this RTL expression describes a base+offset calculation. */
14921 is_based_loc (const_rtx rtl)
14923 return (GET_CODE (rtl) == PLUS
14924 && ((REG_P (XEXP (rtl, 0))
14925 && REGNO (XEXP (rtl, 0)) < FIRST_PSEUDO_REGISTER
14926 && CONST_INT_P (XEXP (rtl, 1)))));
14961 expansion_failed (tree expr, rtx rtl, char const *reason)
14968 if (rtl)
14971 print_rtl (dump_file, rtl);
14980 const_ok_for_output_1 (rtx rtl)
14982 if (targetm.const_not_ok_for_debug_p (rtl))
14984 if (GET_CODE (rtl) != UNSPEC)
14986 expansion_failed (NULL_TREE, rtl,
14999 && (XVECLEN (rtl, 0) == 0
15000 || GET_CODE (XVECEXP (rtl, 0, 0)) != SYMBOL_REF
15001 || SYMBOL_REF_TLS_MODEL (XVECEXP (rtl, 0, 0)) == TLS_MODEL_NONE))
15007 ((XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
15008 ? unspec_strings[XINT (rtl, 1)] : "unknown"),
15012 XINT (rtl, 1));
15013 expansion_failed (NULL_TREE, rtl,
15018 if (CONST_POLY_INT_P (rtl))
15022 of rtl expressions in var tracking to produce such expressions.
15026 switch (GET_CODE (rtl))
15039 FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 0), ALL)
15049 FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 1), ALL)
15061 FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 1), ALL)
15072 if (CONSTANT_POOL_ADDRESS_P (rtl))
15075 get_pool_constant_mark (rtl, &marked);
15080 expansion_failed (NULL_TREE, rtl,
15086 if (SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
15094 if (SYMBOL_REF_EXTERNAL_P (rtl))
15096 tree decl = SYMBOL_REF_DECL (rtl);
15100 expansion_failed (NULL_TREE, rtl,
15109 /* Return true if constant RTL can be emitted in DW_OP_addr or
15114 const_ok_for_output (rtx rtl)
15116 if (GET_CODE (rtl) == SYMBOL_REF)
15117 return const_ok_for_output_1 (rtl);
15119 if (GET_CODE (rtl) == CONST)
15122 FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 0), ALL)
15236 scompare_loc_descriptor_narrow (enum dwarf_location_atom op, rtx rtl,
15254 || (CONST_INT_P (XEXP (rtl, 0))
15255 && (unsigned HOST_WIDE_INT) INTVAL (XEXP (rtl, 0))
15256 == (INTVAL (XEXP (rtl, 0)) & GET_MODE_MASK (op_mode))))
15259 || (CONST_INT_P (XEXP (rtl, 1))
15260 && (unsigned HOST_WIDE_INT) INTVAL (XEXP (rtl, 1))
15261 == (INTVAL (XEXP (rtl, 1)) & GET_MODE_MASK (op_mode)))))
15271 if (CONST_INT_P (XEXP (rtl, 1))
15274 + size_of_int_loc_descriptor (UINTVAL (XEXP (rtl, 1)) << shift)
15276 + size_of_int_loc_descriptor (INTVAL (XEXP (rtl, 1))
15281 op1 = int_loc_descriptor (INTVAL (XEXP (rtl, 1))
15288 if (CONST_INT_P (XEXP (rtl, 1)))
15289 op1 = int_loc_descriptor (UINTVAL (XEXP (rtl, 1)) << shift);
15298 /* Return location descriptor for signed comparison OP RTL. */
15301 scompare_loc_descriptor (enum dwarf_location_atom op, rtx rtl,
15304 machine_mode op_mode = GET_MODE (XEXP (rtl, 0));
15308 op_mode = GET_MODE (XEXP (rtl, 1));
15319 op0 = mem_loc_descriptor (XEXP (rtl, 0), op_mode, mem_mode,
15321 op1 = mem_loc_descriptor (XEXP (rtl, 1), op_mode, mem_mode,
15330 return scompare_loc_descriptor_narrow (op, rtl, int_op_mode, op0, op1);
15338 /* Return location descriptor for unsigned comparison OP RTL. */
15341 ucompare_loc_descriptor (enum dwarf_location_atom op, rtx rtl,
15346 machine_mode test_op_mode = GET_MODE (XEXP (rtl, 0));
15348 test_op_mode = GET_MODE (XEXP (rtl, 1));
15359 op0 = mem_loc_descriptor (XEXP (rtl, 0), op_mode, mem_mode,
15361 op1 = mem_loc_descriptor (XEXP (rtl, 1), op_mode, mem_mode,
15375 if (CONST_INT_P (XEXP (rtl, 0)))
15376 op0 = int_loc_descriptor (INTVAL (XEXP (rtl, 0)) & mask);
15384 if (CONST_INT_P (XEXP (rtl, 1)))
15385 op1 = int_loc_descriptor (INTVAL (XEXP (rtl, 1)) & mask);
15399 if (CONST_INT_P (XEXP (rtl, 1)))
15401 + INTVAL (XEXP (rtl, 1)));
15412 minmax_loc_descriptor (rtx rtl, machine_mode mode,
15426 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15428 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
15437 if (GET_CODE (rtl) == UMIN || GET_CODE (rtl) == UMAX)
15485 if (GET_CODE (rtl) == SMIN || GET_CODE (rtl) == UMIN)
15499 if ((GET_CODE (rtl) == SMIN || GET_CODE (rtl) == SMAX)
15511 typed_binop (enum dwarf_location_atom op, rtx rtl, dw_die_ref type_die,
15518 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15520 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
15568 clz_loc_descriptor (rtx rtl, scalar_int_mode mode,
15579 if (GET_MODE (XEXP (rtl, 0)) != mode)
15582 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15587 if (GET_CODE (rtl) == CLZ)
15592 else if (GET_CODE (rtl) == FFS)
15607 l1label = mem_loc_descriptor (GET_CODE (rtl) == FFS
15617 if (GET_CODE (rtl) != CLZ)
15644 add_loc_descr (&ret, new_loc_descr (GET_CODE (rtl) == CLZ
15679 popcount_loc_descriptor (rtx rtl, scalar_int_mode mode,
15686 if (GET_MODE (XEXP (rtl, 0)) != mode)
15689 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15712 add_loc_descr (&ret, new_loc_descr (GET_CODE (rtl) == POPCOUNT
15739 bswap_loc_descriptor (rtx rtl, scalar_int_mode mode,
15751 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15823 rotate_loc_descriptor (rtx rtl, scalar_int_mode mode,
15826 rtx rtlop1 = XEXP (rtl, 1);
15832 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
15861 if (GET_CODE (rtl) == ROTATERT)
15877 if (GET_CODE (rtl) == ROTATE)
15889 for DEBUG_PARAMETER_REF RTL. */
15892 parameter_ref_descriptor (rtx rtl)
15899 gcc_assert (TREE_CODE (DEBUG_PARAMETER_REF_DECL (rtl)) == PARM_DECL);
15903 ref = lookup_decl_die (DEBUG_PARAMETER_REF_DECL (rtl));
15914 ret->dw_loc_oprnd1.v.val_decl_ref = DEBUG_PARAMETER_REF_DECL (rtl);
15919 /* The following routine converts the RTL for a variable or parameter
15925 the RTL for a memory-resident object into its Dwarf postfix expression
15926 equivalent. This routine recursively descends an RTL tree, turning
15929 MODE is the mode that should be assumed for the rtl if it is VOIDmode.
15937 mem_loc_descriptor (rtx rtl, machine_mode mode,
15948 mode = GET_MODE (rtl);
15955 rtl = targetm.delegitimize_address (rtl);
15957 if (mode != GET_MODE (rtl) && GET_MODE (rtl) != VOIDmode)
15961 switch (GET_CODE (rtl))
15966 return mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode, initialized);
15974 if (!subreg_lowpart_p (rtl))
15976 inner = SUBREG_REG (rtl);
15980 inner = XEXP (rtl, 0);
16037 && rtl != arg_pointer_rtx
16038 && rtl != frame_pointer_rtx
16049 if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
16055 dbx_regnum = dbx_reg_number (rtl);
16078 if (REGNO (rtl) < FIRST_PSEUDO_REGISTER)
16079 mem_loc_result = based_loc_descr (rtl, 0, VAR_INIT_STATUS_INITIALIZED);
16082 && crtl->args.internal_arg_pointer == rtl
16085 /* If RTL is internal_arg_pointer, which has been optimized
16095 || !is_a <scalar_int_mode> (GET_MODE (XEXP (rtl, 0)), &inner_mode))
16097 op0 = mem_loc_descriptor (XEXP (rtl, 0), inner_mode,
16101 else if (GET_CODE (rtl) == ZERO_EXTEND
16118 if (GET_CODE (rtl) == SIGN_EXTEND)
16134 GET_CODE (rtl) == ZERO_EXTEND);
16156 rtx new_rtl = avoid_constant_pool_reference (rtl);
16157 if (new_rtl != rtl)
16165 mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0),
16166 get_address_mode (rtl), mode,
16169 mem_loc_result = tls_mem_loc_descriptor (rtl);
16203 return mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode, initialized);
16220 if (GET_CODE (rtl) == UNSPEC)
16228 FOR_EACH_SUBRTX_VAR (iter, array, rtl, ALL)
16229 if (*iter != rtl && !CONSTANT_P (*iter))
16238 FOR_EACH_SUBRTX_VAR (iter, array, rtl, ALL)
16248 rtl = gen_rtx_CONST (GET_MODE (rtl), rtl);
16252 if (GET_CODE (rtl) == SYMBOL_REF
16253 && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
16261 temp = new_addr_loc_descr (rtl, dtprel_true);
16274 if (!const_ok_for_output (rtl))
16276 if (GET_CODE (rtl) == CONST)
16277 switch (GET_CODE (XEXP (rtl, 0)))
16287 arg = XEXP (XEXP (rtl, 0), 0);
16299 mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), int_mode,
16307 mem_loc_result = new_addr_loc_descr (rtl, dtprel_false);
16308 vec_safe_push (used_rtx_array, rtl);
16315 expansion_failed (NULL_TREE, rtl,
16322 if (REG_P (ENTRY_VALUE_EXP (rtl)))
16326 op0 = mem_loc_descriptor (ENTRY_VALUE_EXP (rtl), mode,
16330 unsigned int dbx_regnum = dbx_reg_number (ENTRY_VALUE_EXP (rtl));
16337 else if (MEM_P (ENTRY_VALUE_EXP (rtl))
16338 && REG_P (XEXP (ENTRY_VALUE_EXP (rtl), 0)))
16340 op0 = mem_loc_descriptor (ENTRY_VALUE_EXP (rtl), mode,
16355 mem_loc_result = parameter_ref_descriptor (rtl);
16361 rtl = XEXP (rtl, 1);
16368 rtl = gen_rtx_PLUS (mode, XEXP (rtl, 0),
16369 gen_int_mode (GET_CODE (rtl) == PRE_INC
16378 if (is_based_loc (rtl)
16381 || XEXP (rtl, 0) == arg_pointer_rtx
16382 || XEXP (rtl, 0) == frame_pointer_rtx))
16383 mem_loc_result = based_loc_descr (XEXP (rtl, 0),
16384 INTVAL (XEXP (rtl, 1)),
16388 mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
16393 if (CONST_INT_P (XEXP (rtl, 1))
16396 loc_descr_plus_const (&mem_loc_result, INTVAL (XEXP (rtl, 1)));
16399 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
16425 mem_loc_result = typed_binop (DW_OP_div, rtl,
16452 op0 = mem_loc_descriptor (XEXP (rtl, 0), int_mode, mem_mode,
16455 rtx rtlop1 = XEXP (rtl, 1);
16484 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
16486 if (XEXP (rtl, 0) == XEXP (rtl, 1))
16495 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
16511 mem_loc_result = typed_binop (DW_OP_mod, rtl,
16517 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
16519 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
16545 mem_loc_result = typed_binop (DW_OP_div, rtl,
16564 op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
16580 && trunc_int_for_mode (INTVAL (rtl), ptr_mode) == INTVAL (rtl))
16584 mem_loc_result = int_loc_descriptor (INTVAL (rtl));
16595 if (INTVAL (rtl) >= 0
16598 && trunc_int_for_mode (INTVAL (rtl), amode) == INTVAL (rtl)
16601 && size_of_int_loc_descriptor (INTVAL (rtl)) + 1 + 1
16604 mem_loc_result = int_loc_descriptor (INTVAL (rtl));
16613 INTVAL (rtl));
16624 = double_int::from_shwi (INTVAL (rtl));
16643 || (GET_MODE (rtl) == VOIDmode
16660 = rtx_to_double_int (rtl);
16668 unsigned int elt_size = insert_float (rtl, array);
16694 *mem_loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, mode);
16699 mem_loc_result = int_loc_descriptor (rtx_to_poly_int64 (rtl));
16703 mem_loc_result = scompare_loc_descriptor (DW_OP_eq, rtl, mem_mode);
16707 mem_loc_result = scompare_loc_descriptor (DW_OP_ge, rtl, mem_mode);
16711 mem_loc_result = scompare_loc_descriptor (DW_OP_gt, rtl, mem_mode);
16715 mem_loc_result = scompare_loc_descriptor (DW_OP_le, rtl, mem_mode);
16719 mem_loc_result = scompare_loc_descriptor (DW_OP_lt, rtl, mem_mode);
16723 mem_loc_result = scompare_loc_descriptor (DW_OP_ne, rtl, mem_mode);
16727 mem_loc_result = ucompare_loc_descriptor (DW_OP_ge, rtl, mem_mode);
16731 mem_loc_result = ucompare_loc_descriptor (DW_OP_gt, rtl, mem_mode);
16735 mem_loc_result = ucompare_loc_descriptor (DW_OP_le, rtl, mem_mode);
16739 mem_loc_result = ucompare_loc_descriptor (DW_OP_lt, rtl, mem_mode);
16749 mem_loc_result = minmax_loc_descriptor (rtl, mode, mem_mode);
16754 rtl, 1))
16755 && CONST_INT_P (XEXP (rtl, 2))
16757 && is_a <scalar_int_mode> (GET_MODE (XEXP (rtl, 0)), &inner_mode)
16760 && ((unsigned) INTVAL (XEXP (rtl, 1))
16761 + (unsigned) INTVAL (XEXP (rtl, 2))
16765 op0 = mem_loc_descriptor (XEXP (rtl, 0), inner_mode,
16769 if (GET_CODE (rtl) == SIGN_EXTRACT)
16774 size = INTVAL (XEXP (rtl, 1));
16775 shift = INTVAL (XEXP (rtl, 2));
16797 op0 = mem_loc_descriptor (XEXP (rtl, 0),
16798 GET_MODE (XEXP (rtl, 0)) == VOIDmode
16799 ? word_mode : GET_MODE (XEXP (rtl, 0)),
16801 op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode,
16803 op2 = mem_loc_descriptor (XEXP (rtl, 2), mode, mem_mode,
16832 op0 = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (XEXP (rtl, 0)),
16836 if (is_a <scalar_int_mode> (GET_MODE (XEXP (rtl, 0)), &int_mode)
16837 && (GET_CODE (rtl) == FLOAT
16841 GET_CODE (rtl) == UNSIGNED_FLOAT);
16850 type_die = base_type_for_mode (mode, GET_CODE (rtl) == UNSIGNED_FIX);
16859 && (GET_CODE (rtl) == FIX
16874 mem_loc_result = clz_loc_descriptor (rtl, int_mode, mem_mode);
16880 mem_loc_result = popcount_loc_descriptor (rtl, int_mode, mem_mode);
16885 mem_loc_result = bswap_loc_descriptor (rtl, int_mode, mem_mode);
16891 mem_loc_result = rotate_loc_descriptor (rtl, int_mode, mem_mode);
16944 resolve_one_addr (&rtl);
16947 /* RTL sequences inside PARALLEL record a series of DWARF operations for
16956 for (; index < XVECLEN (rtl, 0); index++)
16958 rtx elem = XVECEXP (rtl, 0, index);
16990 print_rtl (stderr, rtl);
17070 for DEBUG_IMPLICIT_PTR RTL. */
17073 implicit_ptr_descriptor (rtx rtl, HOST_WIDE_INT offset)
17080 gcc_assert (TREE_CODE (DEBUG_IMPLICIT_PTR_DECL (rtl)) == VAR_DECL
17081 || TREE_CODE (DEBUG_IMPLICIT_PTR_DECL (rtl)) == PARM_DECL
17082 || TREE_CODE (DEBUG_IMPLICIT_PTR_DECL (rtl)) == RESULT_DECL);
17083 ref = lookup_decl_die (DEBUG_IMPLICIT_PTR_DECL (rtl));
17095 ret->dw_loc_oprnd1.v.val_decl_ref = DEBUG_IMPLICIT_PTR_DECL (rtl);
17113 loc_descriptor (rtx rtl, machine_mode mode,
17119 switch (GET_CODE (rtl))
17127 if (REG_P (SUBREG_REG (rtl)) && subreg_lowpart_p (rtl))
17128 loc_result = loc_descriptor (SUBREG_REG (rtl),
17129 GET_MODE (SUBREG_REG (rtl)), initialized);
17135 loc_result = reg_loc_descriptor (rtl, initialized);
17139 loc_result = mem_loc_descriptor (XEXP (rtl, 0), get_address_mode (rtl),
17140 GET_MODE (rtl), initialized);
17142 loc_result = tls_mem_loc_descriptor (rtl);
17145 rtx new_rtl = avoid_constant_pool_reference (rtl);
17146 if (new_rtl != rtl)
17152 loc_result = concat_loc_descriptor (XEXP (rtl, 0), XEXP (rtl, 1),
17157 loc_result = concatn_loc_descriptor (rtl, initialized);
17162 if (GET_CODE (PAT_VAR_LOCATION_LOC (rtl)) != PARALLEL)
17164 rtx loc = PAT_VAR_LOCATION_LOC (rtl);
17171 rtl = XEXP (rtl, 1);
17176 rtvec par_elems = XVEC (rtl, 0);
17214 INTVAL (rtl));
17220 mode = GET_MODE (rtl);
17224 gcc_assert (mode == GET_MODE (rtl) || VOIDmode == GET_MODE (rtl));
17238 = rtx_to_double_int (rtl);
17245 unsigned int elt_size = insert_float (rtl, array);
17257 mode = GET_MODE (rtl);
17266 *loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, int_mode);
17272 mode = GET_MODE (rtl);
17282 if (!CONST_VECTOR_NUNITS (rtl).is_constant (&length))
17285 unsigned int elt_size = GET_MODE_UNIT_SIZE (GET_MODE (rtl));
17292 gcc_assert (mode == GET_MODE (rtl) || VOIDmode == GET_MODE (rtl));
17298 rtx elt = CONST_VECTOR_ELT (rtl, i);
17306 rtx elt = CONST_VECTOR_ELT (rtl, i);
17326 || CONST_SCALAR_INT_P (XEXP (rtl, 0))
17327 || CONST_DOUBLE_AS_FLOAT_P (XEXP (rtl, 0))
17328 || GET_CODE (XEXP (rtl, 0)) == CONST_VECTOR)
17330 loc_result = loc_descriptor (XEXP (rtl, 0), mode, initialized);
17335 if (!const_ok_for_output (rtl))
17343 loc_result = new_addr_loc_descr (rtl, dtprel_false);
17345 vec_safe_push (used_rtx_array, rtl);
17350 loc_result = implicit_ptr_descriptor (rtl, 0);
17354 if (GET_CODE (XEXP (rtl, 0)) == DEBUG_IMPLICIT_PTR
17355 && CONST_INT_P (XEXP (rtl, 1)))
17358 = implicit_ptr_descriptor (XEXP (rtl, 0), INTVAL (XEXP (rtl, 1)));
17365 && GET_MODE (rtl) == int_mode
17371 loc_result = mem_loc_descriptor (rtl, mode, VOIDmode, initialized);
17960 /* Get an RTL for this, if something has been emitted. */
17961 rtx rtl = lookup_constant_def (loc);
17963 if (!rtl || !MEM_P (rtl))
17965 gcc_assert (!rtl);
17968 gcc_assert (GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF);
17973 if (!TREE_ASM_WRITTEN (SYMBOL_REF_DECL (XEXP (rtl, 0))))
17979 return mem_loc_descriptor (XEXP (rtl, 0), get_address_mode (rtl),
17980 GET_MODE (rtl), VAR_INIT_STATUS_INITIALIZED);
18846 rtx rtl;
18884 rtl = rtl_for_decl_location (loc);
18885 if (rtl == NULL_RTX)
18888 if (!MEM_P (rtl))
18890 rtl = XEXP (rtl, 0);
18891 if (! CONSTANT_P (rtl))
18894 ret = new_addr_loc_descr (rtl, dtprel);
18948 rtx rtl;
18957 rtl = rtl_for_decl_location (loc);
18958 if (rtl == NULL_RTX)
18986 expansion_failed (loc, NULL_RTX, "DECL has no RTL");
18989 else if (CONST_INT_P (rtl))
18991 HOST_WIDE_INT val = INTVAL (rtl);
18996 else if (GET_CODE (rtl) == CONST_STRING)
19001 else if (CONSTANT_P (rtl) && const_ok_for_output (rtl))
19002 ret = new_addr_loc_descr (rtl, dtprel_false);
19010 ret = loc_descriptor (rtl, VOIDmode,
19016 mode = GET_MODE (rtl);
19018 if (MEM_P (rtl))
19021 mode = get_address_mode (rtl);
19022 rtl = XEXP (rtl, 0);
19025 ret = mem_loc_descriptor (rtl, mode, mem_mode,
19029 expansion_failed (loc, rtl,
19030 "failed to produce loc descriptor for rtl");
20199 insert_float (const_rtx rtl, unsigned char *array)
20203 scalar_float_mode mode = as_a <scalar_float_mode> (GET_MODE (rtl));
20205 real_to_target (val, CONST_DOUBLE_REAL_VALUE (rtl), mode);
20230 add_const_value_attribute (dw_die_ref die, machine_mode mode, rtx rtl)
20234 switch (GET_CODE (rtl))
20238 HOST_WIDE_INT val = INTVAL (rtl);
20252 wide_int w = rtx_mode_t (rtl, int_mode);
20264 && !SCALAR_FLOAT_MODE_P (GET_MODE (rtl)))
20266 CONST_DOUBLE_HIGH (rtl), CONST_DOUBLE_LOW (rtl));
20269 scalar_float_mode mode = as_a <scalar_float_mode> (GET_MODE (rtl));
20272 unsigned int elt_size = insert_float (rtl, array);
20282 if (!CONST_VECTOR_NUNITS (rtl).is_constant (&length))
20285 machine_mode mode = GET_MODE (rtl);
20304 rtx elt = CONST_VECTOR_ELT (rtl, i);
20312 rtx elt = CONST_VECTOR_ELT (rtl, i);
20329 resolve_one_addr (&rtl);
20331 loc_result = new_addr_loc_descr (rtl, dtprel_false);
20334 vec_safe_push (used_rtx_array, rtl);
20340 if (CONSTANT_P (XEXP (rtl, 0)))
20341 return add_const_value_attribute (die, mode, XEXP (rtl, 0));
20344 if (!const_ok_for_output (rtl))
20375 if (GET_CODE (XEXP (rtl, 0)) == CONST_STRING
20376 && MEM_READONLY_P (rtl)
20377 && GET_MODE (rtl) == BLKmode)
20379 add_AT_string (die, DW_AT_const_value, XSTR (XEXP (rtl, 0), 0));
20430 /* Generate an RTL constant from a decl initializer INIT with decl type TYPE,
20436 rtx rtl = NULL_RTX;
20459 rtl = gen_rtx_CONST_STRING (VOIDmode,
20461 rtl = gen_rtx_MEM (BLKmode, rtl);
20462 MEM_READONLY_P (rtl) = 1;
20481 immediate RTL constant, expand it now. We must be careful not to
20523 rtl = expand_expr (init, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
20526 gcc_assert (!rtl || !MEM_P (rtl));
20529 return rtl;
20532 /* Generate RTL for the variable DECL to represent its location. */
20537 rtx rtl;
20610 rtl = DECL_RTL_IF_SET (decl);
20617 if (rtl
20618 && (CONSTANT_P (rtl)
20619 || (MEM_P (rtl)
20620 && CONSTANT_P (XEXP (rtl, 0)))
20621 || (REG_P (rtl)
20625 rtl = targetm.delegitimize_address (rtl);
20626 return rtl;
20628 rtl = NULL_RTX;
20632 if (rtl == NULL_RTX
20633 || is_pseudo_reg (rtl)
20634 || (MEM_P (rtl)
20635 && is_pseudo_reg (XEXP (rtl, 0))
20638 && GET_MODE (rtl) == GET_MODE (DECL_INCOMING_RTL (decl))))
20647 all cases where (rtl == NULL_RTX) just below. */
20649 rtl = DECL_INCOMING_RTL (decl);
20650 else if ((rtl == NULL_RTX || is_pseudo_reg (rtl))
20657 rtl = inc;
20661 rtl = adjust_address_nv (inc, dmode,
20665 rtl = inc;
20672 parameter is not the same as the mode of the rtl. */
20677 else if (MEM_P (rtl)
20678 && XEXP (rtl, 0) != const0_rtx
20679 && ! CONSTANT_P (XEXP (rtl, 0))
20683 && (!REG_P (XEXP (rtl, 0))
20684 || REGNO (XEXP (rtl, 0)) == HARD_FRAME_POINTER_REGNUM
20685 || REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM
20687 || REGNO (XEXP (rtl, 0)) == ARG_POINTER_REGNUM
20692 && TYPE_MODE (TREE_TYPE (decl)) != GET_MODE (rtl)
20696 machine_mode addr_mode = get_address_mode (rtl);
20700 rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)),
20701 plus_constant (addr_mode, XEXP (rtl, 0), offset));
20705 && rtl
20706 && MEM_P (rtl)
20707 && GET_MODE (rtl) != TYPE_MODE (TREE_TYPE (decl)))
20709 machine_mode addr_mode = get_address_mode (rtl);
20711 GET_MODE (rtl));
20720 rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)),
20721 plus_constant (addr_mode, XEXP (rtl, 0), offset));
20727 if (!rtl && VAR_P (decl) && DECL_INITIAL (decl))
20728 rtl = rtl_for_decl_init (DECL_INITIAL (decl), TREE_TYPE (decl));
20730 if (rtl)
20731 rtl = targetm.delegitimize_address (rtl);
20736 if (rtl)
20737 rtl = avoid_constant_pool_reference (rtl);
20739 /* Try harder to get a rtl. If this symbol ends up not being emitted
20742 if (rtl == NULL_RTX
20751 rtl = make_decl_rtl_for_debug (decl);
20752 if (!MEM_P (rtl)
20753 || GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
20754 || SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
20755 rtl = NULL_RTX;
20758 return rtl;
20833 rtx rtl;
20851 /* Try to get some constant RTL for this decl, and use that as the value of
20854 rtl = rtl_for_decl_location (decl);
20855 if (rtl && (CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
20856 && add_const_value_attribute (die, DECL_MODE (decl), rtl))
20873 rtl = NOTE_VAR_LOCATION_LOC (node->loc);
20874 if (GET_CODE (rtl) == EXPR_LIST)
20875 rtl = XEXP (rtl, 0);
20876 if ((CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
20877 && add_const_value_attribute (die, DECL_MODE (decl), rtl))
20962 rtx rtl = rtl_for_decl_init (init, type);
20963 if (rtl)
20964 return add_const_value_attribute (die, TYPE_MODE (type), rtl);
22078 /* Get the function's name, as described by its RTL. This may be different
22407 /* Get the decl's label, as described by its RTL. This may be different
23929 will reference in the rtl; the latter is what we've told the
29781 dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, entry->addr.rtl,
29788 entry->addr.rtl);
30610 rtx rtl = *addr;
30612 if (GET_CODE (rtl) == CONST_STRING)
30614 size_t len = strlen (XSTR (rtl, 0)) + 1;
30615 tree t = build_string (len, XSTR (rtl, 0));
30619 rtl = lookup_constant_def (t);
30620 if (!rtl || !MEM_P (rtl))
30622 rtl = XEXP (rtl, 0);
30623 if (GET_CODE (rtl) == SYMBOL_REF
30624 && SYMBOL_REF_DECL (rtl)
30625 && !TREE_ASM_WRITTEN (SYMBOL_REF_DECL (rtl)))
30627 vec_safe_push (used_rtx_array, rtl);
30628 *addr = rtl;
30632 if (GET_CODE (rtl) == SYMBOL_REF
30633 && SYMBOL_REF_DECL (rtl))
30635 if (TREE_CONSTANT_POOL_ADDRESS_P (rtl))
30637 if (!TREE_ASM_WRITTEN (DECL_INITIAL (SYMBOL_REF_DECL (rtl))))
30640 else if (!TREE_ASM_WRITTEN (SYMBOL_REF_DECL (rtl)))
30644 if (GET_CODE (rtl) == CONST)
30647 FOR_EACH_SUBRTX_PTR (iter, array, &XEXP (rtl, 0), ALL)
30662 rtx rtl = output_constant_def (t, 1);
30669 if (!rtl || !MEM_P (rtl))
30671 rtl = XEXP (rtl, 0);
30672 if (GET_CODE (rtl) != SYMBOL_REF
30673 || SYMBOL_REF_DECL (rtl) == NULL_TREE)
30676 decl = SYMBOL_REF_DECL (rtl);
30680 vec_safe_push (used_rtx_array, rtl);
30692 return rtl;
30705 rtx rtl = loc->dw_loc_oprnd1.v.val_addr;
30710 if (GET_CODE (rtl) == CONST
30711 && GET_CODE (XEXP (rtl, 0)) == PLUS
30712 && CONST_INT_P (XEXP (XEXP (rtl, 0), 1)))
30714 offset = INTVAL (XEXP (XEXP (rtl, 0), 1));
30715 rtl = XEXP (XEXP (rtl, 0), 0);
30717 if (GET_CODE (rtl) == CONST_STRING)
30719 size_t len = strlen (XSTR (rtl, 0)) + 1;
30720 tree t = build_string (len, XSTR (rtl, 0));
30725 rtl = string_cst_pool_decl (t);
30726 if (!rtl)
30729 if (GET_CODE (rtl) == SYMBOL_REF && SYMBOL_REF_DECL (rtl))
30731 decl = SYMBOL_REF_DECL (rtl);
30787 rtx rtl = loc->dw_loc_oprnd1.val_entry->addr.rtl;
30788 if (!resolve_one_addr (&rtl))
30792 = add_addr_table_entry (rtl, ate_kind_rtx);
30986 rtx rtl = string_cst_pool_decl (TREE_OPERAND (init, 0));
30987 if (!rtl)
30989 decl = SYMBOL_REF_DECL (rtl);
31581 inchash::add_rtx (val1->val_entry->addr.rtl, hstate);
31819 rtx ax1 = valx1->val_entry->addr.rtl;
31820 rtx ay1 = valy1->val_entry->addr.rtl;