diff options
author | burley <burley@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-09 22:33:09 +0000 |
---|---|---|
committer | burley <burley@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-09 22:33:09 +0000 |
commit | 75df2b366b1e8da560d677c16c3172f5395e7ca1 (patch) | |
tree | 8603463cc204a9f6c71beec7b3187fc890e892c6 /gcc/varasm.c | |
parent | 4c4e6867742aeabe3fbbb15ac4f54d1d7e23162c (diff) | |
download | gcc-75df2b366b1e8da560d677c16c3172f5395e7ca1.tar.gz |
Add some transitive closure
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26850 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 84746f6dba3..e4eef2d9b49 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3718,6 +3718,33 @@ mark_constant_pool () insn = XEXP (insn, 1)) if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') mark_constants (PATTERN (insn)); + + /* It's possible that the only reference to a symbol is in a symbol + that's in the constant pool. This happens in Fortran under some + situations. (When the constant contains the address of another + constant, and only the first is used directly in an insn.) + This is potentially suboptimal if there's ever a possibility of + backwards (in pool order) 2'd level references. However, it's + not clear that 2'd level references can happen. */ + for (pool = first_pool; pool; pool = pool->next) + { + struct pool_sym *sym; + char *label; + + /* skip unmarked entries; no insn refers to them. */ + if (!pool->mark) + continue; + + label = XSTR (pool->constant, 0); + + /* Be sure the symbol's value is marked. */ + for (sym = const_rtx_sym_hash_table[SYMHASH (label)]; sym; + sym = sym->next) + if (sym->label == label) + sym->pool->mark = 1; + /* If we didn't find it, there's something truly wrong here, but it + will be announced by the assembler. */ + } } static void |