+2005-07-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/21828
+ * toplev.c (check_global_declarations): Do not mark undefined
+ variables as DECL_IGNORED_P.
+ * varasm.c (first_global_object_name): GTY it.
+ (weak_global_object_name): Likewise.
+ (notice_global_symbol): Use ggc_strdup, not xstrdup, when creating
+ a string to go into {weak,first}_global_object_name.
+
2005-07-22 DJ Delorie <dj@redhat.com>
* c-format.c (check_function_format): Change warning control
+2005-07-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/21828
+ * gcc.dg/debug/dwarf2/dwarf-uninit.c: New test.
+
2005-07-22 Diego Novillo <dnovillo@redhat.com>
* gcc.dg/tree-ssa/20050719-1.c: New test.
--- /dev/null
+/* { dg-do compile */
+/* { dg-options "-O2 -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler "DW_TAG_variable" } } */
+/* PR debug/21828 */
+
+static int i;
+int main() {
+ i += 3;
+ return 0;
+}
{
decl = vec[i];
- /* Do not emit debug information about variables that are in
- static storage, but not defined. */
- if (TREE_CODE (decl) == VAR_DECL
- && TREE_STATIC (decl)
- && !TREE_ASM_WRITTEN (decl))
- DECL_IGNORED_P (decl) = 1;
-
/* Warn about any function
declared static but not defined.
We don't warn about variables,
#endif
/* The (assembler) name of the first globally-visible object output. */
+extern GTY(()) const char *first_global_object_name;
+extern GTY(()) const char *weak_global_object_name;
+
const char *first_global_object_name;
const char *weak_global_object_name;
if (!*type)
{
const char *p;
- char *name;
+ const char *name;
rtx decl_rtl = DECL_RTL (decl);
p = targetm.strip_name_encoding (XSTR (XEXP (decl_rtl, 0), 0));
- name = xstrdup (p);
+ name = ggc_strdup (p);
*type = name;
}