#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
+/* Define this so we can link with print-rtl.o to get debug_rtx function. */
+char **insn_name_ptr = 0;
+
extern void free ();
extern rtx read_rtx ();
{
/* These cases are valid for constant attributes, but can't be
simplified. */
+ exp = copy_rtx (exp);
RTX_UNCHANGING_P (exp) = 1;
break;
}
case SYMBOL_REF:
if (!attr->is_const || RTX_UNCHANGING_P (exp))
break;
- RTX_UNCHANGING_P (exp) = 1;
exp = convert_const_symbol_ref (exp, attr);
+ RTX_UNCHANGING_P (exp) = 1;
check_attr_value (exp, attr);
/* Goto COND case since this is now a COND. Note that while the
new expression is rescanned, all symbol_ref notes are mared as
else
abort ();
- /* If uses an address, must return original expression. */
+ /* If uses an address, must return original expression. But set the
+ RTX_UNCHANGING_P bit so we don't try to simplify it again. */
address_used = 0;
walk_attr_value (newexp);
if (address_used)
- return exp;
+ {
+ if (! RTX_UNCHANGING_P (exp))
+ exp = copy_rtx (exp);
+
+ RTX_UNCHANGING_P (exp) = 1;
+ return exp;
+ }
else
return newexp;
}
/* We have already simplified this expression. Simplifying it again
won't buy anything unless we weren't given a valid insn code
to process (i.e., we are canonicalizing something.). */
- if (insn_code != -2)
- RTX_UNCHANGING_P (newexp) = 1;
+ if (insn_code != -2 && ! RTX_UNCHANGING_P (newexp))
+ {
+ newexp = copy_rtx (newexp);
+ RTX_UNCHANGING_P (newexp) = 1;
+ }
return newexp;
}