From 0e3df013838bbdda708670f1dd2d53806e7c4c37 Mon Sep 17 00:00:00 2001 From: Craig Burley Date: Sun, 9 May 1999 22:33:09 +0000 Subject: [PATCH] Add some transitive closure From-SVN: r26850 --- gcc/ChangeLog | 5 +++++ gcc/varasm.c | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40d12c79755..8e7cc8e666e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon May 10 01:28:10 1999 Craig Burley + + From Fri May 7 9:31:41 1999 Donn Terry (donn@interix.com): + * varasm.c (mark_constant_pool): Add some transitive closure. + Sun May 9 22:51:04 1999 Craig Burley Fix gcc.dg/990506-0.c: 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 -- 2.30.2