+2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR debug/23336
+ * c-typeck.c (build_external_type): Mark used enum types.
+ * dwarf2out.c (dwarf2out_abstract_function): Save and restore
+ cfun also.
+ (gen_subprogram_die): Whitespace fix.
+
2006-08-01 Jan Hubicka <jh@suse.cz>
* tree-outof-ssa.c (check_replaceable): Do not allocate def_vars
if (TREE_CODE (ref) == CONST_DECL)
{
+ used_types_insert (TREE_TYPE (ref));
ref = DECL_INITIAL (ref);
TREE_CONSTANT (ref) = 1;
TREE_INVARIANT (ref) = 1;
+2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR debug/23336
+ * pt.c (tsubst_copy_and_build): Mark used enum types.
+ * semantics.c (finish_id_expression): Likewise.
+
2006-07-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/6634
/* As in finish_id_expression, we resolve enumeration constants
to their underlying values. */
if (TREE_CODE (t) == CONST_DECL)
- return DECL_INITIAL (t);
+ {
+ used_types_insert (TREE_TYPE (t));
+ return DECL_INITIAL (t);
+ }
return t;
default:
{
*idk = CP_ID_KIND_NONE;
if (!processing_template_decl)
- return DECL_INITIAL (decl);
+ {
+ used_types_insert (TREE_TYPE (decl));
+ return DECL_INITIAL (decl);
+ }
return decl;
}
else
{
dw_die_ref old_die;
tree save_fn;
+ struct function *save_cfun;
tree context;
int was_abstract = DECL_ABSTRACT (decl);
/* Pretend we've just finished compiling this function. */
save_fn = current_function_decl;
+ save_cfun = cfun;
current_function_decl = decl;
+ cfun = DECL_STRUCT_FUNCTION (decl);
set_decl_abstract_flags (decl, 1);
dwarf2out_decl (decl);
set_decl_abstract_flags (decl, 0);
current_function_decl = save_fn;
+ cfun = save_cfun;
}
/* Helper function of premark_used_types() which gets called through
int declaration = (current_function_decl != decl
|| class_or_namespace_scope_p (context_die));
- premark_used_types();
+ premark_used_types ();
/* It is possible to have both DECL_ABSTRACT and DECLARATION be true if we
started to generate the abstract instance of an inline, decided to output
+2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR debug/23336
+ * lib/gcc-dg.exp (gcc-dg-debug-runtest): Suppress new tests
+ at -g1.
+ * gcc.dg/debug/enum-1.c, g++.dg/debug/enum-1.C,
+ g++.dg/debug/enum-2.C: New.
+
2006-07-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/6634
--- /dev/null
+/* Verify that used enums are output. */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "JTI_MAX" } } */
+
+int var;
+
+enum java_tree_index
+{
+ JTI_MAX
+};
+
+void function (void)
+{
+ var = JTI_MAX;
+}
+
--- /dev/null
+/* Verify that used enums are output. */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "JTI_MAX" } } */
+
+int var;
+
+enum java_tree_index
+{
+ JTI_MAX
+};
+
+template<int X>
+void tmpl (void)
+{
+ var = JTI_MAX + X;
+}
+
+void
+function (void)
+{
+ tmpl<2>();
+}
--- /dev/null
+/* Verify that used enums are output. */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "JTI_MAX" } } */
+
+int var;
+
+enum java_tree_index
+{
+ JTI_MAX
+};
+
+void function (void)
+{
+ var = JTI_MAX;
+}
+
foreach flags $DEBUG_TORTURE_OPTIONS {
set doit 1
- if { [string match {*/debug-[126].c} "$nshort"] \
+
+ # These tests check for information which may be deliberately
+ # suppressed at -g1.
+ if { ([string match {*/debug-[126].c} "$nshort"] \
+ || [string match {*/enum-1.c} "$nshort"] \
+ || [string match {*/enum-[12].C} "$nshort"]) \
&& [string match "*1" [lindex "$flags" 0] ] } {
set doit 0
}