Commit 2436a91b by Ulrich Weigand Committed by Ulrich Weigand

varasm.c (struct rtx_const): Change type of un.addr member to struct holding an…

varasm.c (struct rtx_const): Change type of un.addr member to struct holding an additional 'symbol' member.

	* varasm.c (struct rtx_const): Change type of un.addr member
	to struct holding an additional 'symbol' member.
	(decode_rtx_const): Re-enable optimization to count SYMBOL_REFs
	with equal string addresses as equal.
	(simplify_subtraction): Adapt to struct rtx_const change.

From-SVN: r64406
parent af6fd53f
2003-03-15 Ulrich Weigand <uweigand@de.ibm.com>
* varasm.c (struct rtx_const): Change type of un.addr member
to struct holding an additional 'symbol' member.
(decode_rtx_const): Re-enable optimization to count SYMBOL_REFs
with equal string addresses as equal.
(simplify_subtraction): Adapt to struct rtx_const change.
2003-03-15 Neil Booth <neil@daikokuya.co.uk> 2003-03-15 Neil Booth <neil@daikokuya.co.uk>
* fix-header.c (read_scan_file): Read main file before handling -D. * fix-header.c (read_scan_file): Read main file before handling -D.
......
...@@ -2115,7 +2115,11 @@ struct rtx_const GTY(()) ...@@ -2115,7 +2115,11 @@ struct rtx_const GTY(())
ENUM_BITFIELD(machine_mode) mode : 16; ENUM_BITFIELD(machine_mode) mode : 16;
union rtx_const_un { union rtx_const_un {
REAL_VALUE_TYPE GTY ((tag ("4"))) du; REAL_VALUE_TYPE GTY ((tag ("4"))) du;
struct addr_const GTY ((tag ("1"))) addr; struct rtx_const_u_addr {
rtx base;
const char *symbol;
HOST_WIDE_INT offset;
} GTY ((tag ("1"))) addr;
struct rtx_const_u_di { struct rtx_const_u_di {
HOST_WIDE_INT high; HOST_WIDE_INT high;
HOST_WIDE_INT low; HOST_WIDE_INT low;
...@@ -3045,13 +3049,12 @@ decode_rtx_const (mode, x, value) ...@@ -3045,13 +3049,12 @@ decode_rtx_const (mode, x, value)
if (value->kind >= RTX_INT && value->un.addr.base != 0) if (value->kind >= RTX_INT && value->un.addr.base != 0)
switch (GET_CODE (value->un.addr.base)) switch (GET_CODE (value->un.addr.base))
{ {
#if 0
case SYMBOL_REF: case SYMBOL_REF:
/* Use the string's address, not the SYMBOL_REF's address, /* Use the string's address, not the SYMBOL_REF's address,
for the sake of addresses of library routines. */ for the sake of addresses of library routines. */
value->un.addr.base = (rtx) XSTR (value->un.addr.base, 0); value->un.addr.symbol = XSTR (value->un.addr.base, 0);
value->un.addr.base = NULL_RTX;
break; break;
#endif
case LABEL_REF: case LABEL_REF:
/* For a LABEL_REF, compare labels. */ /* For a LABEL_REF, compare labels. */
...@@ -3076,7 +3079,8 @@ simplify_subtraction (x) ...@@ -3076,7 +3079,8 @@ simplify_subtraction (x)
if (val0.kind >= RTX_INT if (val0.kind >= RTX_INT
&& val0.kind == val1.kind && val0.kind == val1.kind
&& val0.un.addr.base == val1.un.addr.base) && val0.un.addr.base == val1.un.addr.base
&& val0.un.addr.symbol == val1.un.addr.symbol)
return GEN_INT (val0.un.addr.offset - val1.un.addr.offset); return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
return x; return x;
......
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