Commit 2adc7f12 by Janis Johnson Committed by Janis Johnson

rtl.h (RTX_FLAG): New macro.

	* rtl.h (RTX_FLAG): New macro.
	* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
	* final.c (alter_subreg): Use macro to access rtx flag.
	* integrate.c (copy_rtx_and_substitute): Use new access macro.
	* print-rtl.c (print_rtx): Use new access macro.

	* cse.c (insert): Check rtx code before accessing flag.

	* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
	ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
	(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
	convert_const_symbol_ref, make_canonical, make_alternative_compare,
	evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
	simplify_test_exp, optimize_attrs, simplify_by_exploding,
	find_and_mark_used_attributes, unmark_used_attributes,
	add_values_to_cover, simplify_with_current_value,
	simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
	copy_rtx_unchanging, main): Use new access macros.

From-SVN: r52645
parent b7c89afe
2002-04-22 Janis Johnson <janis187@us.ibm.com>
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
2002-04-22 Tom Rix <trix@redhat.com> 2002-04-22 Tom Rix <trix@redhat.com>
* expmed.c (init_expmed): Generate shifted constant once. * expmed.c (init_expmed): Generate shifted constant once.
......
...@@ -1601,8 +1601,8 @@ insert (x, classp, hash, mode) ...@@ -1601,8 +1601,8 @@ insert (x, classp, hash, mode)
elt->is_const = (CONSTANT_P (x) elt->is_const = (CONSTANT_P (x)
/* GNU C++ takes advantage of this for `this' /* GNU C++ takes advantage of this for `this'
(and other const values). */ (and other const values). */
|| (RTX_UNCHANGING_P (x) || (GET_CODE (x) == REG
&& GET_CODE (x) == REG && RTX_UNCHANGING_P (x)
&& REGNO (x) >= FIRST_PSEUDO_REGISTER) && REGNO (x) >= FIRST_PSEUDO_REGISTER)
|| FIXED_BASE_PLUS_P (x)); || FIXED_BASE_PLUS_P (x));
......
...@@ -2286,11 +2286,11 @@ copy_most_rtx (orig, may_share) ...@@ -2286,11 +2286,11 @@ copy_most_rtx (orig, may_share)
copy = rtx_alloc (code); copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
copy->in_struct = orig->in_struct; RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
copy->volatil = orig->volatil; RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
copy->unchanging = orig->unchanging; RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
copy->integrated = orig->integrated; RTX_FLAG (copy, integrated) = RTX_FLAG (orig, integrated);
copy->frame_related = orig->frame_related; RTX_FLAG (copy, frame_related) = RTX_FLAG (orig, frame_related);
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
...@@ -2423,7 +2423,7 @@ copy_rtx_if_shared (orig) ...@@ -2423,7 +2423,7 @@ copy_rtx_if_shared (orig)
/* This rtx may not be shared. If it has already been seen, /* This rtx may not be shared. If it has already been seen,
replace it with a copy of itself. */ replace it with a copy of itself. */
if (x->used) if (RTX_FLAG (x, used))
{ {
rtx copy; rtx copy;
...@@ -2434,7 +2434,7 @@ copy_rtx_if_shared (orig) ...@@ -2434,7 +2434,7 @@ copy_rtx_if_shared (orig)
x = copy; x = copy;
copied = 1; copied = 1;
} }
x->used = 1; RTX_FLAG (x, used) = 1;
/* Now scan the subexpressions recursively. /* Now scan the subexpressions recursively.
We can store any replaced subexpressions directly into X We can store any replaced subexpressions directly into X
...@@ -2513,7 +2513,7 @@ reset_used_flags (x) ...@@ -2513,7 +2513,7 @@ reset_used_flags (x)
break; break;
} }
x->used = 0; RTX_FLAG (x, used) = 0;
format_ptr = GET_RTX_FORMAT (code); format_ptr = GET_RTX_FORMAT (code);
for (i = 0; i < GET_RTX_LENGTH (code); i++) for (i = 0; i < GET_RTX_LENGTH (code); i++)
...@@ -4467,8 +4467,8 @@ gen_sequence () ...@@ -4467,8 +4467,8 @@ gen_sequence ()
We only return the pattern of an insn if its code is INSN and it We only return the pattern of an insn if its code is INSN and it
has no notes. This ensures that no information gets lost. */ has no notes. This ensures that no information gets lost. */
if (len == 1 if (len == 1
&& ! RTX_FRAME_RELATED_P (first_insn)
&& GET_CODE (first_insn) == INSN && GET_CODE (first_insn) == INSN
&& ! RTX_FRAME_RELATED_P (first_insn)
/* Don't throw away any reg notes. */ /* Don't throw away any reg notes. */
&& REG_NOTES (first_insn) == 0) && REG_NOTES (first_insn) == 0)
return PATTERN (first_insn); return PATTERN (first_insn);
...@@ -4592,14 +4592,14 @@ copy_insn_1 (orig) ...@@ -4592,14 +4592,14 @@ copy_insn_1 (orig)
/* We do not copy the USED flag, which is used as a mark bit during /* We do not copy the USED flag, which is used as a mark bit during
walks over the RTL. */ walks over the RTL. */
copy->used = 0; RTX_FLAG (copy, used) = 0;
/* We do not copy JUMP, CALL, or FRAME_RELATED for INSNs. */ /* We do not copy JUMP, CALL, or FRAME_RELATED for INSNs. */
if (GET_RTX_CLASS (code) == 'i') if (GET_RTX_CLASS (code) == 'i')
{ {
copy->jump = 0; RTX_FLAG (copy, jump) = 0;
copy->call = 0; RTX_FLAG (copy, call) = 0;
copy->frame_related = 0; RTX_FLAG (copy, frame_related) = 0;
} }
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
......
...@@ -2761,7 +2761,7 @@ alter_subreg (xp) ...@@ -2761,7 +2761,7 @@ alter_subreg (xp)
ORIGINAL_REGNO (x) = ORIGINAL_REGNO (y); ORIGINAL_REGNO (x) = ORIGINAL_REGNO (y);
/* This field has a different meaning for REGs and SUBREGs. Make /* This field has a different meaning for REGs and SUBREGs. Make
sure to clear it! */ sure to clear it! */
x->used = 0; RTX_FLAG (x, used) = 0;
} }
else else
abort (); abort ();
......
...@@ -86,15 +86,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -86,15 +86,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
definitions (each would be accessed through a pointer). definitions (each would be accessed through a pointer).
We use the flags in an RTX as follows: We use the flags in an RTX as follows:
`unchanging' (RTX_UNCHANGING_P): This rtx is fully simplified `unchanging' (ATTR_IND_SIMPLIFIED_P): This rtx is fully simplified
independent of the insn code. independent of the insn code.
`in_struct' (MEM_IN_STRUCT_P): This rtx is fully simplified `in_struct' (ATTR_CURR_SIMPLIFIED_P): This rtx is fully simplified
for the insn code currently being processed (see optimize_attrs). for the insn code currently being processed (see optimize_attrs).
`integrated' (RTX_INTEGRATED_P): This rtx is permanent and unique `integrated' (ATTR_PERMANENT_P): This rtx is permanent and unique
(see attr_rtx). (see attr_rtx).
`volatil' (MEM_VOLATILE_P): During simplify_by_exploding the value of an `volatil' (ATTR_EQ_ATTR_P): During simplify_by_exploding the value of an
EQ_ATTR rtx is true if !volatil and false if volatil. */ EQ_ATTR rtx is true if !volatil and false if volatil. */
#define ATTR_IND_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), unchanging))
#define ATTR_CURR_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), in_struct))
#define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), integrated))
#define ATTR_EQ_ATTR_P(RTX) (RTX_FLAG((RTX), volatil))
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
...@@ -262,7 +267,7 @@ static struct function_unit *units; ...@@ -262,7 +267,7 @@ static struct function_unit *units;
The algorithm relies on sharing EQ_ATTR nodes: if two nodes in an The algorithm relies on sharing EQ_ATTR nodes: if two nodes in an
expression are the same, the will also have the same address. We find expression are the same, the will also have the same address. We find
all the EQ_ATTR nodes by marking them MEM_VOLATILE_P. This bit later all the EQ_ATTR nodes by marking them ATTR_EQ_ATTR_P. This bit later
represents the value of an EQ_ATTR node, so once all nodes are marked, represents the value of an EQ_ATTR node, so once all nodes are marked,
they are also given an initial value of FALSE. they are also given an initial value of FALSE.
...@@ -344,7 +349,7 @@ int optimize = 0; ...@@ -344,7 +349,7 @@ int optimize = 0;
/* Simplify an expression. Only call the routine if there is something to /* Simplify an expression. Only call the routine if there is something to
simplify. */ simplify. */
#define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \ #define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \
(RTX_UNCHANGING_P (EXP) || MEM_IN_STRUCT_P (EXP) ? (EXP) \ (ATTR_IND_SIMPLIFIED_P (EXP) || ATTR_CURR_SIMPLIFIED_P (EXP) ? (EXP) \
: simplify_test_exp (EXP, INSN_CODE, INSN_INDEX)) : simplify_test_exp (EXP, INSN_CODE, INSN_INDEX))
/* Simplify (eq_attr ("alternative") ...) /* Simplify (eq_attr ("alternative") ...)
...@@ -532,10 +537,10 @@ attr_hash_add_string (hashcode, str) ...@@ -532,10 +537,10 @@ attr_hash_add_string (hashcode, str)
} }
/* Generate an RTL expression, but avoid duplicates. /* Generate an RTL expression, but avoid duplicates.
Set the RTX_INTEGRATED_P flag for these permanent objects. Set the ATTR_PERMANENT_P flag for these permanent objects.
In some cases we cannot uniquify; then we return an ordinary In some cases we cannot uniquify; then we return an ordinary
impermanent rtx with RTX_INTEGRATED_P clear. impermanent rtx with ATTR_PERMANENT_P clear.
Args are like gen_rtx, but without the mode: Args are like gen_rtx, but without the mode:
...@@ -560,7 +565,7 @@ attr_rtx_1 (code, p) ...@@ -560,7 +565,7 @@ attr_rtx_1 (code, p)
rtx arg0 = va_arg (p, rtx); rtx arg0 = va_arg (p, rtx);
/* A permanent object cannot point to impermanent ones. */ /* A permanent object cannot point to impermanent ones. */
if (! RTX_INTEGRATED_P (arg0)) if (! ATTR_PERMANENT_P (arg0))
{ {
rt_val = rtx_alloc (code); rt_val = rtx_alloc (code);
XEXP (rt_val, 0) = arg0; XEXP (rt_val, 0) = arg0;
...@@ -589,7 +594,7 @@ attr_rtx_1 (code, p) ...@@ -589,7 +594,7 @@ attr_rtx_1 (code, p)
rtx arg1 = va_arg (p, rtx); rtx arg1 = va_arg (p, rtx);
/* A permanent object cannot point to impermanent ones. */ /* A permanent object cannot point to impermanent ones. */
if (! RTX_INTEGRATED_P (arg0) || ! RTX_INTEGRATED_P (arg1)) if (! ATTR_PERMANENT_P (arg0) || ! ATTR_PERMANENT_P (arg1))
{ {
rt_val = rtx_alloc (code); rt_val = rtx_alloc (code);
XEXP (rt_val, 0) = arg0; XEXP (rt_val, 0) = arg0;
...@@ -713,7 +718,7 @@ attr_rtx_1 (code, p) ...@@ -713,7 +718,7 @@ attr_rtx_1 (code, p)
rtl_obstack = old_obstack; rtl_obstack = old_obstack;
attr_hash_add_rtx (hashcode, rt_val); attr_hash_add_rtx (hashcode, rt_val);
RTX_INTEGRATED_P (rt_val) = 1; ATTR_PERMANENT_P (rt_val) = 1;
return rt_val; return rt_val;
} }
...@@ -810,7 +815,7 @@ static int ...@@ -810,7 +815,7 @@ static int
attr_equal_p (x, y) attr_equal_p (x, y)
rtx x, y; rtx x, y;
{ {
return (x == y || (! (RTX_INTEGRATED_P (x) && RTX_INTEGRATED_P (y)) return (x == y || (! (ATTR_PERMANENT_P (x) && ATTR_PERMANENT_P (y))
&& rtx_equal_p (x, y))); && rtx_equal_p (x, y)));
} }
...@@ -828,7 +833,7 @@ attr_copy_rtx (orig) ...@@ -828,7 +833,7 @@ attr_copy_rtx (orig)
const char *format_ptr; const char *format_ptr;
/* No need to copy a permanent object. */ /* No need to copy a permanent object. */
if (RTX_INTEGRATED_P (orig)) if (ATTR_PERMANENT_P (orig))
return orig; return orig;
code = GET_CODE (orig); code = GET_CODE (orig);
...@@ -852,10 +857,10 @@ attr_copy_rtx (orig) ...@@ -852,10 +857,10 @@ attr_copy_rtx (orig)
copy = rtx_alloc (code); copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
copy->in_struct = orig->in_struct; ATTR_IND_SIMPLIFIED_P (copy) = ATTR_IND_SIMPLIFIED_P (orig);
copy->volatil = orig->volatil; ATTR_CURR_SIMPLIFIED_P (copy) = ATTR_CURR_SIMPLIFIED_P (orig);
copy->unchanging = orig->unchanging; ATTR_PERMANENT_P (copy) = ATTR_PERMANENT_P (orig);
copy->integrated = orig->integrated; ATTR_EQ_ATTR_P (copy) = ATTR_EQ_ATTR_P (orig);
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
...@@ -945,7 +950,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -945,7 +950,7 @@ check_attr_test (exp, is_const, lineno)
{ {
XSTR (exp, 0) = alternative_name; XSTR (exp, 0) = alternative_name;
/* This can't be simplified any further. */ /* This can't be simplified any further. */
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
return exp; return exp;
} }
else else
...@@ -964,7 +969,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -964,7 +969,7 @@ check_attr_test (exp, is_const, lineno)
constant attribute, so don't expand this until it's time to constant attribute, so don't expand this until it's time to
write the test expression. */ write the test expression. */
if (attr->is_const) if (attr->is_const)
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
if (attr->is_numeric) if (attr->is_numeric)
{ {
...@@ -1026,7 +1031,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1026,7 +1031,7 @@ check_attr_test (exp, is_const, lineno)
fatal ("RTL operator \"%s\" not valid in constant attribute test", fatal ("RTL operator \"%s\" not valid in constant attribute test",
GET_RTX_NAME (GET_CODE (exp))); GET_RTX_NAME (GET_CODE (exp)));
/* These cases can't be simplified. */ /* These cases can't be simplified. */
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
break; break;
case LE: case LT: case GT: case GE: case LE: case LT: case GT: case GE:
...@@ -1038,7 +1043,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1038,7 +1043,7 @@ check_attr_test (exp, is_const, lineno)
attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 0), 0)), attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 0), 0)),
attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 1), 0))); attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 1), 0)));
/* These cases can't be simplified. */ /* These cases can't be simplified. */
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
break; break;
case SYMBOL_REF: case SYMBOL_REF:
...@@ -1047,7 +1052,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1047,7 +1052,7 @@ check_attr_test (exp, is_const, lineno)
/* These cases are valid for constant attributes, but can't be /* These cases are valid for constant attributes, but can't be
simplified. */ simplified. */
exp = attr_rtx (SYMBOL_REF, XSTR (exp, 0)); exp = attr_rtx (SYMBOL_REF, XSTR (exp, 0));
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
break; break;
} }
default: default:
...@@ -1405,7 +1410,7 @@ convert_const_symbol_ref (exp, attr) ...@@ -1405,7 +1410,7 @@ convert_const_symbol_ref (exp, attr)
*p = TOUPPER (*p); *p = TOUPPER (*p);
value = attr_rtx (SYMBOL_REF, string); value = attr_rtx (SYMBOL_REF, string);
RTX_UNCHANGING_P (value) = 1; ATTR_IND_SIMPLIFIED_P (value) = 1;
XVECEXP (condexp, 0, 2 * i) = attr_rtx (EQ, exp, value); XVECEXP (condexp, 0, 2 * i) = attr_rtx (EQ, exp, value);
...@@ -1446,18 +1451,18 @@ make_canonical (attr, exp) ...@@ -1446,18 +1451,18 @@ make_canonical (attr, exp)
break; break;
case SYMBOL_REF: case SYMBOL_REF:
if (!attr->is_const || RTX_UNCHANGING_P (exp)) if (!attr->is_const || ATTR_IND_SIMPLIFIED_P (exp))
break; break;
/* The SYMBOL_REF is constant for a given run, so mark it as unchanging. /* The SYMBOL_REF is constant for a given run, so mark it as unchanging.
This makes the COND something that won't be considered an arbitrary This makes the COND something that won't be considered an arbitrary
expression by walk_attr_value. */ expression by walk_attr_value. */
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
#if 0 #if 0
/* ??? Why do we do this? With attribute values { A B C D E }, this /* ??? Why do we do this? With attribute values { A B C D E }, this
tends to generate (!(x==A) && !(x==B) && !(x==C) && !(x==D)) rather tends to generate (!(x==A) && !(x==B) && !(x==C) && !(x==D)) rather
than (x==E). */ than (x==E). */
exp = convert_const_symbol_ref (exp, attr); exp = convert_const_symbol_ref (exp, attr);
RTX_UNCHANGING_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
exp = check_attr_value (exp, attr); exp = check_attr_value (exp, attr);
/* Goto COND case since this is now a COND. Note that while the /* Goto COND case since this is now a COND. Note that while the
new expression is rescanned, all symbol_ref notes are marked as new expression is rescanned, all symbol_ref notes are marked as
...@@ -2824,7 +2829,7 @@ make_alternative_compare (mask) ...@@ -2824,7 +2829,7 @@ make_alternative_compare (mask)
; ;
newexp = attr_rtx (EQ_ATTR, alternative_name, attr_numeral (i)); newexp = attr_rtx (EQ_ATTR, alternative_name, attr_numeral (i));
RTX_UNCHANGING_P (newexp) = 1; ATTR_IND_SIMPLIFIED_P (newexp) = 1;
return newexp; return newexp;
} }
...@@ -2932,7 +2937,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2932,7 +2937,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
abort (); abort ();
/* If uses an address, must return original expression. But set the /* If uses an address, must return original expression. But set the
RTX_UNCHANGING_P bit so we don't try to simplify it again. */ ATTR_IND_SIMPLIFIED_P bit so we don't try to simplify it again. */
address_used = 0; address_used = 0;
walk_attr_value (newexp); walk_attr_value (newexp);
...@@ -2940,7 +2945,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2940,7 +2945,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
if (address_used) if (address_used)
{ {
/* This had `&& current_alternative_string', which seems to be wrong. */ /* This had `&& current_alternative_string', which seems to be wrong. */
if (! RTX_UNCHANGING_P (exp)) if (! ATTR_IND_SIMPLIFIED_P (exp))
return copy_rtx_unchanging (exp); return copy_rtx_unchanging (exp);
return exp; return exp;
} }
...@@ -3198,7 +3203,7 @@ attr_rtx_cost (x) ...@@ -3198,7 +3203,7 @@ attr_rtx_cost (x)
/* Simplify test expression and use temporary obstack in order to avoid /* Simplify test expression and use temporary obstack in order to avoid
memory bloat. Use RTX_UNCHANGING_P to avoid unnecesary simplifications memory bloat. Use ATTR_IND_SIMPLIFIED to avoid unnecesary simplifications
and avoid unnecesary copying if possible. */ and avoid unnecesary copying if possible. */
static rtx static rtx
...@@ -3208,7 +3213,7 @@ simplify_test_exp_in_temp (exp, insn_code, insn_index) ...@@ -3208,7 +3213,7 @@ simplify_test_exp_in_temp (exp, insn_code, insn_index)
{ {
rtx x; rtx x;
struct obstack *old; struct obstack *old;
if (RTX_UNCHANGING_P (exp)) if (ATTR_IND_SIMPLIFIED_P (exp))
return exp; return exp;
old = rtl_obstack; old = rtl_obstack;
rtl_obstack = temp_obstack; rtl_obstack = temp_obstack;
...@@ -3241,7 +3246,7 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3241,7 +3246,7 @@ simplify_test_exp (exp, insn_code, insn_index)
rtx newexp = exp; rtx newexp = exp;
/* Don't re-simplify something we already simplified. */ /* Don't re-simplify something we already simplified. */
if (RTX_UNCHANGING_P (exp) || MEM_IN_STRUCT_P (exp)) if (ATTR_IND_SIMPLIFIED_P (exp) || ATTR_CURR_SIMPLIFIED_P (exp))
return exp; return exp;
switch (GET_CODE (exp)) switch (GET_CODE (exp))
...@@ -3491,7 +3496,7 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3491,7 +3496,7 @@ simplify_test_exp (exp, insn_code, insn_index)
won't buy anything unless we weren't given a valid insn code won't buy anything unless we weren't given a valid insn code
to process (i.e., we are canonicalizing something.). */ to process (i.e., we are canonicalizing something.). */
if (insn_code != -2 /* Seems wrong: && current_alternative_string. */ if (insn_code != -2 /* Seems wrong: && current_alternative_string. */
&& ! RTX_UNCHANGING_P (newexp)) && ! ATTR_IND_SIMPLIFIED_P (newexp))
return copy_rtx_unchanging (newexp); return copy_rtx_unchanging (newexp);
return newexp; return newexp;
...@@ -3559,7 +3564,7 @@ optimize_attrs () ...@@ -3559,7 +3564,7 @@ optimize_attrs ()
/* Process one insn code at a time. */ /* Process one insn code at a time. */
for (i = -2; i < insn_code_number; i++) for (i = -2; i < insn_code_number; i++)
{ {
/* Clear the MEM_IN_STRUCT_P flag everywhere relevant. /* Clear the ATTR_CURR_SIMPLIFIED_P flag everywhere relevant.
We use it to mean "already simplified for this insn". */ We use it to mean "already simplified for this insn". */
for (iv = insn_code_values[i]; iv; iv = iv->next) for (iv = insn_code_values[i]; iv; iv = iv->next)
clear_struct_flag (iv->av->value); clear_struct_flag (iv->av->value);
...@@ -3747,13 +3752,13 @@ simplify_by_exploding (exp) ...@@ -3747,13 +3752,13 @@ simplify_by_exploding (exp)
most_tests = -1; most_tests = -1;
for (i = num_marks = 0; i < total; i++) for (i = num_marks = 0; i < total; i++)
if (GET_CODE (condval[i]) == CONST_STRING if (GET_CODE (condval[i]) == CONST_STRING
&& ! MEM_VOLATILE_P (condval[i])) && ! ATTR_EQ_ATTR_P (condval[i]))
{ {
/* Mark the unmarked constant value and count how many are marked. */ /* Mark the unmarked constant value and count how many are marked. */
MEM_VOLATILE_P (condval[i]) = 1; ATTR_EQ_ATTR_P (condval[i]) = 1;
for (j = new_marks = 0; j < total; j++) for (j = new_marks = 0; j < total; j++)
if (GET_CODE (condval[j]) == CONST_STRING if (GET_CODE (condval[j]) == CONST_STRING
&& MEM_VOLATILE_P (condval[j])) && ATTR_EQ_ATTR_P (condval[j]))
new_marks++; new_marks++;
if (new_marks - num_marks > most_tests) if (new_marks - num_marks > most_tests)
{ {
...@@ -3764,7 +3769,7 @@ simplify_by_exploding (exp) ...@@ -3764,7 +3769,7 @@ simplify_by_exploding (exp)
} }
/* Clear all the marks. */ /* Clear all the marks. */
for (i = 0; i < total; i++) for (i = 0; i < total; i++)
MEM_VOLATILE_P (condval[i]) = 0; ATTR_EQ_ATTR_P (condval[i]) = 0;
/* Give up if nothing is constant. */ /* Give up if nothing is constant. */
if (num_marks == 0) if (num_marks == 0)
...@@ -3796,7 +3801,7 @@ simplify_by_exploding (exp) ...@@ -3796,7 +3801,7 @@ simplify_by_exploding (exp)
return ret; return ret;
} }
/* Set the MEM_VOLATILE_P flag for all EQ_ATTR expressions in EXP and /* Set the ATTR_EQ_ATTR_P flag for all EQ_ATTR expressions in EXP and
verify that EXP can be simplified to a constant term if all the EQ_ATTR verify that EXP can be simplified to a constant term if all the EQ_ATTR
tests have known value. */ tests have known value. */
...@@ -3810,14 +3815,14 @@ find_and_mark_used_attributes (exp, terms, nterms) ...@@ -3810,14 +3815,14 @@ find_and_mark_used_attributes (exp, terms, nterms)
switch (GET_CODE (exp)) switch (GET_CODE (exp))
{ {
case EQ_ATTR: case EQ_ATTR:
if (! MEM_VOLATILE_P (exp)) if (! ATTR_EQ_ATTR_P (exp))
{ {
rtx link = rtx_alloc (EXPR_LIST); rtx link = rtx_alloc (EXPR_LIST);
XEXP (link, 0) = exp; XEXP (link, 0) = exp;
XEXP (link, 1) = *terms; XEXP (link, 1) = *terms;
*terms = link; *terms = link;
*nterms += 1; *nterms += 1;
MEM_VOLATILE_P (exp) = 1; ATTR_EQ_ATTR_P (exp) = 1;
} }
return 1; return 1;
...@@ -3850,7 +3855,7 @@ find_and_mark_used_attributes (exp, terms, nterms) ...@@ -3850,7 +3855,7 @@ find_and_mark_used_attributes (exp, terms, nterms)
} }
} }
/* Clear the MEM_VOLATILE_P flag in all EQ_ATTR expressions on LIST and /* Clear the ATTR_EQ_ATTR_P flag in all EQ_ATTR expressions on LIST and
in the values of the NDIM-dimensional attribute space SPACE. */ in the values of the NDIM-dimensional attribute space SPACE. */
static void static void
...@@ -3869,7 +3874,7 @@ unmark_used_attributes (list, space, ndim) ...@@ -3869,7 +3874,7 @@ unmark_used_attributes (list, space, ndim)
{ {
exp = XEXP (link, 0); exp = XEXP (link, 0);
if (GET_CODE (exp) == EQ_ATTR) if (GET_CODE (exp) == EQ_ATTR)
MEM_VOLATILE_P (exp) = 0; ATTR_EQ_ATTR_P (exp) = 0;
} }
} }
...@@ -3905,7 +3910,7 @@ add_values_to_cover (dim) ...@@ -3905,7 +3910,7 @@ add_values_to_cover (dim)
if (GET_CODE (av->value) == CONST_STRING) if (GET_CODE (av->value) == CONST_STRING)
{ {
exp = attr_eq (dim->attr->name, XSTR (av->value, 0)); exp = attr_eq (dim->attr->name, XSTR (av->value, 0));
if (MEM_VOLATILE_P (exp)) if (ATTR_EQ_ATTR_P (exp))
continue; continue;
link = rtx_alloc (EXPR_LIST); link = rtx_alloc (EXPR_LIST);
...@@ -3995,7 +4000,7 @@ simplify_with_current_value (exp, space, ndim) ...@@ -3995,7 +4000,7 @@ simplify_with_current_value (exp, space, ndim)
{ {
x = XEXP (space[i].current_value, 0); x = XEXP (space[i].current_value, 0);
if (GET_CODE (x) == EQ_ATTR) if (GET_CODE (x) == EQ_ATTR)
MEM_VOLATILE_P (x) = 0; ATTR_EQ_ATTR_P (x) = 0;
} }
exp = simplify_with_current_value_aux (exp); exp = simplify_with_current_value_aux (exp);
...@@ -4005,13 +4010,13 @@ simplify_with_current_value (exp, space, ndim) ...@@ -4005,13 +4010,13 @@ simplify_with_current_value (exp, space, ndim)
{ {
x = XEXP (space[i].current_value, 0); x = XEXP (space[i].current_value, 0);
if (GET_CODE (x) == EQ_ATTR) if (GET_CODE (x) == EQ_ATTR)
MEM_VOLATILE_P (x) = 1; ATTR_EQ_ATTR_P (x) = 1;
} }
return exp; return exp;
} }
/* Reduce the expression EXP based on the MEM_VOLATILE_P settings of /* Reduce the expression EXP based on the ATTR_EQ_ATTR_P settings of
all EQ_ATTR expressions. */ all EQ_ATTR expressions. */
static rtx static rtx
...@@ -4024,7 +4029,7 @@ simplify_with_current_value_aux (exp) ...@@ -4024,7 +4029,7 @@ simplify_with_current_value_aux (exp)
switch (GET_CODE (exp)) switch (GET_CODE (exp))
{ {
case EQ_ATTR: case EQ_ATTR:
if (MEM_VOLATILE_P (exp)) if (ATTR_EQ_ATTR_P (exp))
return false_rtx; return false_rtx;
else else
return true_rtx; return true_rtx;
...@@ -4091,7 +4096,7 @@ simplify_with_current_value_aux (exp) ...@@ -4091,7 +4096,7 @@ simplify_with_current_value_aux (exp)
} }
} }
/* Clear the MEM_IN_STRUCT_P flag in EXP and its subexpressions. */ /* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */
static void static void
clear_struct_flag (x) clear_struct_flag (x)
...@@ -4102,8 +4107,8 @@ clear_struct_flag (x) ...@@ -4102,8 +4107,8 @@ clear_struct_flag (x)
enum rtx_code code; enum rtx_code code;
const char *fmt; const char *fmt;
MEM_IN_STRUCT_P (x) = 0; ATTR_CURR_SIMPLIFIED_P (x) = 0;
if (RTX_UNCHANGING_P (x)) if (ATTR_IND_SIMPLIFIED_P (x))
return; return;
code = GET_CODE (x); code = GET_CODE (x);
...@@ -4914,7 +4919,7 @@ walk_attr_value (exp) ...@@ -4914,7 +4919,7 @@ walk_attr_value (exp)
switch (code) switch (code)
{ {
case SYMBOL_REF: case SYMBOL_REF:
if (! RTX_UNCHANGING_P (exp)) if (! ATTR_IND_SIMPLIFIED_P (exp))
/* Since this is an arbitrary expression, it can look at anything. /* Since this is an arbitrary expression, it can look at anything.
However, constant expressions do not depend on any particular However, constant expressions do not depend on any particular
insn. */ insn. */
...@@ -5986,10 +5991,10 @@ copy_rtx_unchanging (orig) ...@@ -5986,10 +5991,10 @@ copy_rtx_unchanging (orig)
RTX_CODE code; RTX_CODE code;
#endif #endif
if (RTX_UNCHANGING_P (orig) || MEM_IN_STRUCT_P (orig)) if (ATTR_IND_SIMPLIFIED_P (orig) || ATTR_CURR_SIMPLIFIED_P (orig))
return orig; return orig;
MEM_IN_STRUCT_P (orig) = 1; ATTR_CURR_SIMPLIFIED_P (orig) = 1;
return orig; return orig;
#if 0 #if 0
...@@ -6008,7 +6013,7 @@ copy_rtx_unchanging (orig) ...@@ -6008,7 +6013,7 @@ copy_rtx_unchanging (orig)
copy = rtx_alloc (code); copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
RTX_UNCHANGING_P (copy) = 1; ATTR_IND_SIMPLIFIED_P (copy) = 1;
memcpy (&XEXP (copy, 0), &XEXP (orig, 0), memcpy (&XEXP (copy, 0), &XEXP (orig, 0),
GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx)); GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx));
...@@ -6082,8 +6087,8 @@ main (argc, argv) ...@@ -6082,8 +6087,8 @@ main (argc, argv)
XWINT (true_rtx, 0) = 1; XWINT (true_rtx, 0) = 1;
false_rtx = rtx_alloc (CONST_INT); false_rtx = rtx_alloc (CONST_INT);
XWINT (false_rtx, 0) = 0; XWINT (false_rtx, 0) = 0;
RTX_UNCHANGING_P (true_rtx) = RTX_UNCHANGING_P (false_rtx) = 1; ATTR_IND_SIMPLIFIED_P (true_rtx) = ATTR_IND_SIMPLIFIED_P (false_rtx) = 1;
RTX_INTEGRATED_P (true_rtx) = RTX_INTEGRATED_P (false_rtx) = 1; ATTR_PERMANENT_P (true_rtx) = ATTR_PERMANENT_P (false_rtx) = 1;
alternative_name = attr_string ("alternative", strlen ("alternative")); alternative_name = attr_string ("alternative", strlen ("alternative"));
......
...@@ -2209,7 +2209,7 @@ copy_rtx_and_substitute (orig, map, for_lhs) ...@@ -2209,7 +2209,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
if (map->orig_asm_operands_vector == ASM_OPERANDS_INPUT_VEC (orig)) if (map->orig_asm_operands_vector == ASM_OPERANDS_INPUT_VEC (orig))
{ {
copy = rtx_alloc (ASM_OPERANDS); copy = rtx_alloc (ASM_OPERANDS);
copy->volatil = orig->volatil; RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
ASM_OPERANDS_TEMPLATE (copy) = ASM_OPERANDS_TEMPLATE (orig); ASM_OPERANDS_TEMPLATE (copy) = ASM_OPERANDS_TEMPLATE (orig);
ASM_OPERANDS_OUTPUT_CONSTRAINT (copy) ASM_OPERANDS_OUTPUT_CONSTRAINT (copy)
...@@ -2328,9 +2328,9 @@ copy_rtx_and_substitute (orig, map, for_lhs) ...@@ -2328,9 +2328,9 @@ copy_rtx_and_substitute (orig, map, for_lhs)
copy = rtx_alloc (code); copy = rtx_alloc (code);
PUT_MODE (copy, mode); PUT_MODE (copy, mode);
copy->in_struct = orig->in_struct; RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
copy->volatil = orig->volatil; RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
copy->unchanging = orig->unchanging; RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
......
...@@ -154,25 +154,25 @@ print_rtx (in_rtx) ...@@ -154,25 +154,25 @@ print_rtx (in_rtx)
if (! flag_simple) if (! flag_simple)
{ {
if (in_rtx->in_struct) if (RTX_FLAG (in_rtx, in_struct))
fputs ("/s", outfile); fputs ("/s", outfile);
if (in_rtx->volatil) if (RTX_FLAG (in_rtx, volatil))
fputs ("/v", outfile); fputs ("/v", outfile);
if (in_rtx->unchanging) if (RTX_FLAG (in_rtx, unchanging))
fputs ("/u", outfile); fputs ("/u", outfile);
if (in_rtx->integrated) if (RTX_FLAG (in_rtx, integrated))
fputs ("/i", outfile); fputs ("/i", outfile);
if (in_rtx->frame_related) if (RTX_FLAG (in_rtx, frame_related))
fputs ("/f", outfile); fputs ("/f", outfile);
if (in_rtx->jump) if (RTX_FLAG (in_rtx, jump))
fputs ("/j", outfile); fputs ("/j", outfile);
if (in_rtx->call) if (RTX_FLAG (in_rtx, call))
fputs ("/c", outfile); fputs ("/c", outfile);
if (GET_MODE (in_rtx) != VOIDmode) if (GET_MODE (in_rtx) != VOIDmode)
......
...@@ -211,6 +211,7 @@ struct rtx_def ...@@ -211,6 +211,7 @@ struct rtx_def
#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode) #define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE)) #define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
#define RTX_FLAG(RTX,FLAG) ((RTX)->FLAG)
#define RTX_INTEGRATED_P(RTX) ((RTX)->integrated) #define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
#define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging) #define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) ((RTX)->frame_related) #define RTX_FRAME_RELATED_P(RTX) ((RTX)->frame_related)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment