diff options
author | Richard Henderson <rth@cygnus.com> | 2000-04-28 13:25:38 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-04-28 13:25:38 -0700 |
commit | e67cd9f80dd021af3fcf9595b39e2e31864572d4 (patch) | |
tree | 99a03323c8f0558761ac8ee69814fee24379e7c7 /gcc/varasm.c | |
parent | ce48579b9a691b3c6b57f2e6a8f5161f829a2477 (diff) | |
download | gcc-e67cd9f80dd021af3fcf9595b39e2e31864572d4.zip gcc-e67cd9f80dd021af3fcf9595b39e2e31864572d4.tar.gz gcc-e67cd9f80dd021af3fcf9595b39e2e31864572d4.tar.bz2 |
varasm.c (record_constant_1): Record the CODE_LABEL when taking the address of a LABEL_REF.
* varasm.c (record_constant_1): Record the CODE_LABEL when
taking the address of a LABEL_REF.
From-SVN: r33517
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 5224284..0c68220 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2867,9 +2867,24 @@ record_constant_1 (exp) /* Record the offset. */ obstack_grow (&permanent_obstack, (char *) &value.offset, sizeof value.offset); - /* Record the symbol name. */ - obstack_grow (&permanent_obstack, XSTR (value.base, 0), - strlen (XSTR (value.base, 0)) + 1); + + switch (GET_CODE (value.base)) + { + case SYMBOL_REF: + /* Record the symbol name. */ + obstack_grow (&permanent_obstack, XSTR (value.base, 0), + strlen (XSTR (value.base, 0)) + 1); + break; + case LABEL_REF: + /* Record the address of the CODE_LABEL. It may not have + been emitted yet, so it's UID may be zero. But pointer + identity is good enough. */ + obstack_grow (&permanent_obstack, &XEXP (value.base, 0), + sizeof (rtx)); + break; + default: + abort (); + } } return; |