aboutsummaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2005-01-27 01:49:01 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2005-01-27 01:49:01 +0000
commit9ff93eb01ce59be5d7b26428df5e5bf6671bce86 (patch)
treeeaa07f07a8bac1d3a3fb744243c80780d71c498f /gcc/dbxout.c
parent4356a1bf59fa37ac5abeebc13bb2a5676563b7b1 (diff)
downloadgcc-9ff93eb01ce59be5d7b26428df5e5bf6671bce86.zip
gcc-9ff93eb01ce59be5d7b26428df5e5bf6671bce86.tar.gz
gcc-9ff93eb01ce59be5d7b26428df5e5bf6671bce86.tar.bz2
dbxout.c (dbxout_symbol_location): Resolve constant pool references even for variables with NULL DECL_INITIAL.
ChangeLog: * dbxout.c (dbxout_symbol_location): Resolve constant pool references even for variables with NULL DECL_INITIAL. testsuite/ChangeLog: * gcc.dg/20041216-1.c: New test. From-SVN: r94303
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 8c2d6ea..d4c78e9 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -2733,6 +2733,37 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
letter = decl_function_context (decl) ? 'V' : 'S';
+ /* Some ports can transform a symbol ref into a label ref,
+ because the symbol ref is too far away and has to be
+ dumped into a constant pool. Alternatively, the symbol
+ in the constant pool might be referenced by a different
+ symbol. */
+ if (GET_CODE (addr) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (addr))
+ {
+ bool marked;
+ rtx tmp = get_pool_constant_mark (addr, &marked);
+
+ if (GET_CODE (tmp) == SYMBOL_REF)
+ {
+ addr = tmp;
+ if (CONSTANT_POOL_ADDRESS_P (addr))
+ get_pool_constant_mark (addr, &marked);
+ else
+ marked = true;
+ }
+ else if (GET_CODE (tmp) == LABEL_REF)
+ {
+ addr = tmp;
+ marked = true;
+ }
+
+ /* If all references to the constant pool were optimized
+ out, we just ignore the symbol. */
+ if (!marked)
+ return 0;
+ }
+
/* This should be the same condition as in assemble_variable, but
we don't have access to dont_output_data here. So, instead,
we rely on the fact that error_mark_node initializers always
@@ -2747,37 +2778,6 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
code = DBX_STATIC_CONST_VAR_CODE;
else
{
- /* Some ports can transform a symbol ref into a label ref,
- because the symbol ref is too far away and has to be
- dumped into a constant pool. Alternatively, the symbol
- in the constant pool might be referenced by a different
- symbol. */
- if (GET_CODE (addr) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (addr))
- {
- bool marked;
- rtx tmp = get_pool_constant_mark (addr, &marked);
-
- if (GET_CODE (tmp) == SYMBOL_REF)
- {
- addr = tmp;
- if (CONSTANT_POOL_ADDRESS_P (addr))
- get_pool_constant_mark (addr, &marked);
- else
- marked = true;
- }
- else if (GET_CODE (tmp) == LABEL_REF)
- {
- addr = tmp;
- marked = true;
- }
-
- /* If all references to the constant pool were optimized
- out, we just ignore the symbol. */
- if (!marked)
- return 0;
- }
-
/* Ultrix `as' seems to need this. */
#ifdef DBX_STATIC_STAB_DATA_SECTION
data_section ();