From d327457f172ab91732d0789bf925c7510f5e1015 Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Mon, 5 Nov 2012 15:18:10 +0000 Subject: md.texi (Defining Attributes): Document that we are defining HAVE_ATTR_name macors as 1 for defined attributes... * doc/md.texi (Defining Attributes): Document that we are defining HAVE_ATTR_name macors as 1 for defined attributes, and as 0 for undefined special attributes. * final.c (asm_insn_count, align_fuzz): Always define. (insn_current_reference_address): Likewise. (init_insn_lengths): Use if (HAVE_ATTR_length) instead of #ifdef HAVE_ATTR_length. (get_attr_length_1, shorten_branches, final): Likewise. (final_scan_insn, output_asm_name): Likewise. * genattr.c (gen_attr): Define HAVE_ATTR_name macros for defined attributes as 1. Remove ancient get_attr_alternative compatibility code. For special purpose attributes not provided, define HAVE_ATTR_name as 0. In case no length attribute is given, provide stub definitions for insn_*_length* functions, and also include insn-addr.h. In case no enabled attribute is given, provide stub definition. * genattrtab.c (write_length_unit_log): Always write a definition. * hooks.c (hook_int_rtx_1, hook_int_rtx_unreachable): New functions. * hooks.h (hook_int_rtx_1, hook_int_rtx_unreachable): Declare. * lra-int.h (struct lra_insn_recog_data): Make member alternative_enabled_p unconditional. * lra.c (free_insn_recog_data): Use if (HAVE_ATTR_length) instead of #ifdef HAVE_ATTR_length. (lra_set_insn_recog_data): Likewise. Make initialization of alternative_enabled_p unconditional. (lra_update_insn_recog_data): Use #if instead of #ifdef for HAVE_ATTR_enabled. * recog.c [!HAVE_ATTR_enabled] (get_attr_enabled): Don't define. (extract_insn): Check HAVE_ATTR_enabled. (gate_handle_split_before_regstack): Use #if instead of #if defined for HAVE_ATTR_length. From-SVN: r193168 --- gcc/lra.c | 53 +++++++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'gcc/lra.c') diff --git a/gcc/lra.c b/gcc/lra.c index 890af22..0705ad7 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -671,10 +671,8 @@ free_insn_recog_data (lra_insn_recog_data_t data) free (data->dup_loc); if (data->arg_hard_regs != NULL) free (data->arg_hard_regs); -#ifdef HAVE_ATTR_enabled - if (data->alternative_enabled_p != NULL) + if (HAVE_ATTR_enabled && data->alternative_enabled_p != NULL) free (data->alternative_enabled_p); -#endif if (data->icode < 0 && NONDEBUG_INSN_P (data->insn)) { if (data->insn_static_data->operand_alternative != NULL) @@ -1020,9 +1018,7 @@ lra_set_insn_recog_data (rtx insn) data->insn_static_data = &debug_insn_static_data; data->dup_loc = NULL; data->arg_hard_regs = NULL; -#ifdef HAVE_ATTR_enabled data->alternative_enabled_p = NULL; -#endif data->operand_loc = XNEWVEC (rtx *, 1); data->operand_loc[0] = &INSN_VAR_LOCATION_LOC (insn); return data; @@ -1075,9 +1071,7 @@ lra_set_insn_recog_data (rtx insn) = (insn_static_data->operand[i].constraint[0] == '=' ? OP_OUT : insn_static_data->operand[i].constraint[0] == '+' ? OP_INOUT : OP_IN); -#ifdef HAVE_ATTR_enabled data->alternative_enabled_p = NULL; -#endif } else { @@ -1104,28 +1098,27 @@ lra_set_insn_recog_data (rtx insn) memcpy (locs, recog_data.dup_loc, n * sizeof (rtx *)); } data->dup_loc = locs; -#ifdef HAVE_ATTR_enabled - { - bool *bp; - - n = insn_static_data->n_alternatives; - lra_assert (n >= 0); - data->alternative_enabled_p = bp = XNEWVEC (bool, n); - /* Cache the insn because we don't want to call extract_insn - from get_attr_enabled as extract_insn modifies - which_alternative. The attribute enabled should not depend - on insn operands, operand modes, operand types, and operand - constraints. It should depend on the architecture. If it - is not true, we should rewrite this file code to use - extract_insn instead of less expensive insn_extract. */ - recog_data.insn = insn; - for (i = 0; i < n; i++) - { - which_alternative = i; - bp[i] = get_attr_enabled (insn); - } - } -#endif + if (HAVE_ATTR_enabled) + { + bool *bp; + + n = insn_static_data->n_alternatives; + lra_assert (n >= 0); + data->alternative_enabled_p = bp = XNEWVEC (bool, n); + /* Cache the insn because we don't want to call extract_insn + from get_attr_enabled as extract_insn modifies + which_alternative. The attribute enabled should not depend + on insn operands, operand modes, operand types, and operand + constraints. It should depend on the architecture. If it + is not true, we should rewrite this file code to use + extract_insn instead of less expensive insn_extract. */ + recog_data.insn = insn; + for (i = 0; i < n; i++) + { + which_alternative = i; + bp[i] = get_attr_enabled (insn); + } + } } if (GET_CODE (PATTERN (insn)) == CLOBBER || GET_CODE (PATTERN (insn)) == USE) insn_static_data->hard_regs = NULL; @@ -1305,7 +1298,7 @@ lra_update_insn_recog_data (rtx insn) n = insn_static_data->n_dups; if (n != 0) memcpy (data->dup_loc, recog_data.dup_loc, n * sizeof (rtx *)); -#ifdef HAVE_ATTR_enabled +#if HAVE_ATTR_enabled #ifdef ENABLE_CHECKING { int i; -- cgit v1.1