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
This commit is contained in:
parent
4356a1bf59
commit
9ff93eb01c
4 changed files with 63 additions and 31 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-01-26 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* dbxout.c (dbxout_symbol_location): Resolve constant pool references
|
||||
even for variables with NULL DECL_INITIAL.
|
||||
|
||||
2005-01-26 Stuart Hastings <stuart@apple.com>
|
||||
|
||||
* gcc/gimplify.c (shortcut_cond_expr): Re-compute side-effects.
|
||||
|
|
28
gcc/dbxout.c
28
gcc/dbxout.c
|
@ -2733,20 +2733,6 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
|
|||
|
||||
letter = decl_function_context (decl) ? 'V' : 'S';
|
||||
|
||||
/* 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
|
||||
end up in bss for C++ and never end up in bss for C. */
|
||||
if (DECL_INITIAL (decl) == 0
|
||||
|| (!strcmp (lang_hooks.name, "GNU C++")
|
||||
&& DECL_INITIAL (decl) == error_mark_node))
|
||||
code = N_LCSYM;
|
||||
else if (DECL_IN_TEXT_SECTION (decl))
|
||||
/* This is not quite right, but it's the closest
|
||||
of all the codes that Unix defines. */
|
||||
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
|
||||
|
@ -2778,6 +2764,20 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
|
|||
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
|
||||
end up in bss for C++ and never end up in bss for C. */
|
||||
if (DECL_INITIAL (decl) == 0
|
||||
|| (!strcmp (lang_hooks.name, "GNU C++")
|
||||
&& DECL_INITIAL (decl) == error_mark_node))
|
||||
code = N_LCSYM;
|
||||
else if (DECL_IN_TEXT_SECTION (decl))
|
||||
/* This is not quite right, but it's the closest
|
||||
of all the codes that Unix defines. */
|
||||
code = DBX_STATIC_CONST_VAR_CODE;
|
||||
else
|
||||
{
|
||||
/* Ultrix `as' seems to need this. */
|
||||
#ifdef DBX_STATIC_STAB_DATA_SECTION
|
||||
data_section ();
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2005-01-26 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* gcc.dg/20041216-1.c: New test.
|
||||
|
||||
2005-01-26 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
PR objc/18862
|
||||
|
|
23
gcc/testsuite/gcc.dg/20041216-1.c
Normal file
23
gcc/testsuite/gcc.dg/20041216-1.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* This test case would get an unresolved symbol during link
|
||||
because stabs referred to an optimized-away literal pool
|
||||
entry. */
|
||||
|
||||
/* { dg-do run { target s390*-*-* } } */
|
||||
/* { dg-options "-O2 -fno-omit-frame-pointer -gstabs" } */
|
||||
|
||||
int main (void)
|
||||
{
|
||||
static char buf[4096];
|
||||
char *p;
|
||||
|
||||
do
|
||||
{
|
||||
p = buf;
|
||||
asm volatile ("" : : : "memory", "0", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "10", "12");
|
||||
}
|
||||
while (*p);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue