Commit cf526dcc by Richard Kenner

(copy_rtx): A CONST can be shared if it contains a SYMBOL_REF.

A SCRATCH must be shared.
A MEM may be shared if it is at a constant address.

From-SVN: r2924
parent b851ea09
......@@ -264,7 +264,23 @@ copy_rtx (orig)
case CODE_LABEL:
case PC:
case CC0:
case SCRATCH:
/* SCRATCH must be shared because they represent distinct values. */
return orig;
case CONST:
/* CONST can be shared if it contains a SYMBOL_REF. If it contains
a LABEL_REF, it isn't sharable. */
if (GET_CODE (XEXP (orig, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
&& GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT)
return orig;
break;
case MEM:
if (CONSTANT_ADDRESS_P (XEXP (orig, 0)))
return orig;
break;
}
copy = rtx_alloc (code);
......
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