aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHartmut Penner <hpenner@de.ibm.com>2002-02-04 08:29:08 +0000
committerHartmut Penner <hpenner@gcc.gnu.org>2002-02-04 08:29:08 +0000
commitfecaac3765895574348015a1794de65c2e2a64c6 (patch)
tree0b0401d8a5494b815018a2a77fed5e03b51a5fb4 /gcc
parentf7948d51468a9c45abd8fd21a0efee1ec479ad37 (diff)
downloadgcc-fecaac3765895574348015a1794de65c2e2a64c6.zip
gcc-fecaac3765895574348015a1794de65c2e2a64c6.tar.gz
gcc-fecaac3765895574348015a1794de65c2e2a64c6.tar.bz2
varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in constant pool to be identical by string address...
* varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in constant pool to be identical by string address and index. From-SVN: r49471
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/varasm.c24
2 files changed, 26 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index babb0e4..1b6153b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-04 Hartmut Penner <hpenner@de.ibm.com>
+
+ * varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in
+ constant pool to be identical by string address and index.
+
2002-02-04 Anthony Green <green@redhat.com>
* output.h (SECTION_OVERRIDE): Define.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8bd5807..18d2008 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2382,7 +2382,7 @@ decode_addr_const (exp, value)
value->offset = offset;
}
-enum kind { RTX_DOUBLE, RTX_INT };
+enum kind { RTX_DOUBLE, RTX_INT, RTX_UNSPEC };
struct rtx_const
{
ENUM_BITFIELD(kind) kind : 16;
@@ -3613,7 +3613,24 @@ decode_rtx_const (mode, x, value)
abort ();
}
- if (value->kind == RTX_INT && value->un.addr.base != 0)
+ if (value->kind == RTX_INT && value->un.addr.base != 0
+ && GET_CODE (value->un.addr.base) == UNSPEC)
+ {
+ /* For a simple UNSPEC, the base is set to the
+ operand, the kind field is set to the index of
+ the unspec expression.
+ Together with the code below, in case that
+ the operand is a SYMBOL_REF or LABEL_REF,
+ the address of the string or the code_label
+ is taken as base. */
+ if (XVECLEN (value->un.addr.base, 0) == 1)
+ {
+ value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1);
+ value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0);
+ }
+ }
+
+ if (value->kind != RTX_DOUBLE && value->un.addr.base != 0)
switch (GET_CODE (value->un.addr.base))
{
case SYMBOL_REF:
@@ -3643,7 +3660,8 @@ simplify_subtraction (x)
decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
- if (val0.un.addr.base == val1.un.addr.base)
+ if (val0.kind != RTX_DOUBLE && val0.kind == val1.kind
+ && val0.un.addr.base == val1.un.addr.base)
return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
return x;
}