rtx shallow_copy_rtx_stat (const_rtx orig MEM_STAT_DECL) { const unsigned int size = rtx_size (orig); rtx const copy = ggc_alloc_rtx_def_stat (size PASS_MEM_STAT); return (rtx) memcpy (copy, orig, size); }
rtx shallow_copy_rtx (const_rtx orig MEM_STAT_DECL) { const unsigned int size = rtx_size (orig); rtx const copy = ggc_alloc_rtx_def_stat (size PASS_MEM_STAT); memcpy (copy, orig, size); switch (GET_CODE (orig)) { /* RTX codes copy_rtx_if_shared_1 considers are shareable, the used flag is often used for other purposes. */ case REG: case DEBUG_EXPR: case VALUE: CASE_CONST_ANY: case SYMBOL_REF: case CODE_LABEL: case PC: case CC0: case RETURN: case SIMPLE_RETURN: case SCRATCH: break; default: /* For all other RTXes clear the used flag on the copy. */ RTX_FLAG (copy, used) = 0; break; } return copy; }
rtx rtx_alloc_stat_v (RTX_CODE code MEM_STAT_DECL, int extra) { rtx rt = ggc_alloc_rtx_def_stat (RTX_CODE_SIZE (code) + extra PASS_MEM_STAT); /* We want to clear everything up to the FLD array. Normally, this is one int, but we don't want to assume that and it isn't very portable anyway; this is. */ memset (rt, 0, RTX_HDR_SIZE); PUT_CODE (rt, code); if (GATHER_STATISTICS) { rtx_alloc_counts[code]++; rtx_alloc_sizes[code] += RTX_CODE_SIZE (code); } return rt; }