+2007-12-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * dwarf2out.c (reference_to_unused): Don't emit strings in
+ initializers just because of debug information.
+ * tree.h (TREE_ASM_WRITTEN): Document use for STRING_CSTs.
+
2007-12-15 Sebastian Pop <sebastian.pop@amd.com>
* tree-scalar-evolution.c (number_of_iterations_for_all_loops): Replace
if (!node->output)
return *tp;
}
+ else if (TREE_CODE (*tp) == STRING_CST && !TREE_ASM_WRITTEN (*tp))
+ return *tp;
return NULL_TREE;
}
+2007-12-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.dg/debug/const-3.c: New.
+
2007-12-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* g++.dg/other/datasec1.C: Require named section support.
--- /dev/null
+/* Make sure we don't emit strings just because of debug information
+ for string initializers. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+/* { dg-final { scan-assembler-not "dontgenerate" } } */
+static const char *p = "dontgenerate1";
+static const char *q[2] = { 0, "dontgenerate2" };
TREE_ASM_WRITTEN in
VAR_DECL, FUNCTION_DECL, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
- BLOCK, SSA_NAME
+ BLOCK, SSA_NAME, STRING_CST
used_flag:
/* In integral and pointer types, means an unsigned type. */
#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.unsigned_flag)
-/* Nonzero in a VAR_DECL means assembler code has been written.
+/* Nonzero in a VAR_DECL or STRING_CST means assembler code has been written.
Nonzero in a FUNCTION_DECL means that the function has been compiled.
This is interesting in an inline function, since it might not need
to be compiled separately.