aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-09 21:00:49 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-09 21:00:49 +0000
commit50a7abc551accf7febf56ead56c65597bc01676a (patch)
treef2b0299f3ac13dea0d2e51a788d52e8423748b4c
parent55dcde771cf19041b499b327aa1e05b6343feb71 (diff)
* dbxout.c: Include expr.h.
(dbxout_global_decl): Don't suppress for DECL_RTL unset. (dbxout_symbol): Handle DECL_VALUE_EXPR. * Makefile.in (dbxout.o): Add EXPR_H. cp/ * cp-tree.def (ALIAS_DECL): Remove. * cp-lang.c (cp_init_ts): Remove support for it. * error.c (dump_decl): Likewise. * name-lookup.c (pushdecl): Likewise. * semantics.c (finish_id_expression): Likewise. * decl2.c (build_anon_union_vars): Use a VAR_DECL with DECL_VALUE_EXPR instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104106 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/Makefile.in8
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/cp-lang.c5
-rw-r--r--gcc/cp/cp-tree.def4
-rw-r--r--gcc/cp/decl2.c13
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/cp/name-lookup.c1
-rw-r--r--gcc/cp/semantics.c5
-rw-r--r--gcc/dbxout.c37
10 files changed, 54 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 549a9b786e6..1672806b59a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-09 Richard Henderson <rth@redhat.com>
+
+ PR debug/20998
+ * dbxout.c: Include expr.h.
+ (dbxout_global_decl): Don't suppress for DECL_RTL unset.
+ (dbxout_symbol): Handle DECL_VALUE_EXPR.
+ * Makefile.in (dbxout.o): Add EXPR_H.
+
2005-09-09 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/23509
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3ed71862980..f260f37a9fe 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2103,10 +2103,10 @@ optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \
$(RECOG_H) reload.h toplev.h $(GGC_H) real.h $(TM_P_H) except.h \
gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) function.h
-dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
- $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
- insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \
- $(GGC_H) $(OBSTACK_H) gt-dbxout.h
+dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h \
+ langhooks.h insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h \
+ toplev.h $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
$(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ae12c20e2ff..7aa392f7464 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2005-09-09 Richard Henderson <rth@redhat.com>
+
+ PR debug/20998
+ * cp-tree.def (ALIAS_DECL): Remove.
+ * cp-lang.c (cp_init_ts): Remove support for it.
+ * error.c (dump_decl): Likewise.
+ * name-lookup.c (pushdecl): Likewise.
+ * semantics.c (finish_id_expression): Likewise.
+ * decl2.c (build_anon_union_vars): Use a VAR_DECL with
+ DECL_VALUE_EXPR instead.
+
2005-09-09 Mark Mitchell <mark@codesourcery.com>
PR c++/22252
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index c79486a0cfc..38e2e5acd82 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -117,27 +117,22 @@ cp_init_ts (void)
tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_MINIMAL] = 1;
init_shadowed_var_for_decl ();
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 7f0c1fc2342..096d00a8be0 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -87,10 +87,6 @@ DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1)
these to avoid actually creating instances of the empty classes. */
DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0)
-/* A DECL which is really just a placeholder for an expression. Used to
- implement non-class scope anonymous unions. */
-DEFTREECODE (ALIAS_DECL, "alias_decl", tcc_declaration, 0)
-
/* A reference to a member function or member functions from a base
class. BASELINK_FUNCTIONS gives the FUNCTION_DECL,
TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8a7d7d61452..8ef6fa863fd 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1057,7 +1057,7 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
}
/* Walks through the namespace- or function-scope anonymous union
- OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs.
+ OBJECT, with the indicated TYPE, building appropriate VAR_DECLs.
Returns one of the fields for use in the mangled name. */
static tree
@@ -1101,11 +1101,12 @@ build_anon_union_vars (tree type, tree object)
if (DECL_NAME (field))
{
- decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field));
- DECL_INITIAL (decl) = ref;
- TREE_PUBLIC (decl) = 0;
- TREE_STATIC (decl) = 0;
- DECL_EXTERNAL (decl) = 1;
+ decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
+ TREE_PUBLIC (decl) = TREE_PUBLIC (object);
+ TREE_STATIC (decl) = TREE_PUBLIC (object);
+ DECL_EXTERNAL (decl) = DECL_EXTERNAL (object);
+ SET_DECL_VALUE_EXPR (decl, ref);
+ DECL_HAS_VALUE_EXPR_P (decl) = 1;
decl = pushdecl (decl);
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 9905e253aa1..12201198630 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -744,7 +744,6 @@ dump_decl (tree t, int flags)
/* Else fall through. */
case FIELD_DECL:
case PARM_DECL:
- case ALIAS_DECL:
dump_simple_decl (t, TREE_TYPE (t), flags);
break;
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index f936a86cc28..cba93933588 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -831,7 +831,6 @@ pushdecl (tree x)
&& t != NULL_TREE)
&& (TREE_CODE (x) == TYPE_DECL
|| TREE_CODE (x) == VAR_DECL
- || TREE_CODE (x) == ALIAS_DECL
|| TREE_CODE (x) == NAMESPACE_DECL
|| TREE_CODE (x) == CONST_DECL
|| TREE_CODE (x) == TEMPLATE_DECL))
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 36914573e6e..0e926bf1d26 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2747,11 +2747,6 @@ finish_id_expression (tree id_expression,
decl = convert_from_reference (decl);
}
-
- /* Resolve references to variables of anonymous unions
- into COMPONENT_REFs. */
- if (TREE_CODE (decl) == ALIAS_DECL)
- decl = unshare_expr (DECL_INITIAL (decl));
}
if (TREE_DEPRECATED (decl))
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index caff4f2faf9..48c00b5100a 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -89,6 +89,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "target.h"
#include "langhooks.h"
#include "obstack.h"
+#include "expr.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
@@ -1319,9 +1320,7 @@ dbxout_function_decl (tree decl)
static void
dbxout_global_decl (tree decl)
{
- if (TREE_CODE (decl) == VAR_DECL
- && ! DECL_EXTERNAL (decl)
- && DECL_RTL_SET_P (decl)) /* Not necessary? */
+ if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
{
int saved_tree_used = TREE_USED (decl);
TREE_USED (decl) = 1;
@@ -2337,6 +2336,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
tree type = TREE_TYPE (decl);
tree context = NULL_TREE;
int result = 0;
+ rtx decl_rtl;
/* "Intercept" dbxout_symbol() calls like we do all debug_hooks. */
++debug_nesting;
@@ -2421,7 +2421,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
break;
case FUNCTION_DECL:
- if (DECL_RTL (decl) == 0)
+ decl_rtl = DECL_RTL_IF_SET (decl);
+ if (!decl_rtl)
DBXOUT_DECR_NESTING_AND_RETURN (0);
if (DECL_EXTERNAL (decl))
break;
@@ -2432,8 +2433,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
/* Don't mention an inline instance of a nested function. */
if (context && DECL_FROM_INLINE (decl))
break;
- if (!MEM_P (DECL_RTL (decl))
- || GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
+ if (!MEM_P (decl_rtl)
+ || GET_CODE (XEXP (decl_rtl, 0)) != SYMBOL_REF)
break;
dbxout_begin_complex_stabs ();
@@ -2457,8 +2458,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
stabstr_I (DECL_NAME (context));
}
- dbxout_finish_complex_stabs (decl, N_FUN, XEXP (DECL_RTL (decl), 0),
- 0, 0);
+ dbxout_finish_complex_stabs (decl, N_FUN, XEXP (decl_rtl, 0), 0, 0);
break;
case TYPE_DECL:
@@ -2609,14 +2609,25 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
case RESULT_DECL:
/* Named return value, treat like a VAR_DECL. */
+ decl_rtl = DECL_RTL_IF_SET (decl);
+ goto do_var_decl;
+
case VAR_DECL:
- if (! DECL_RTL_SET_P (decl))
- DBXOUT_DECR_NESTING_AND_RETURN (0);
/* Don't mention a variable that is external.
Let the file that defines it describe it. */
if (DECL_EXTERNAL (decl))
break;
+ if (DECL_HAS_VALUE_EXPR_P (decl))
+ decl_rtl = expand_expr (DECL_VALUE_EXPR (decl), NULL_RTX, VOIDmode,
+ EXPAND_INITIALIZER);
+ else
+ decl_rtl = DECL_RTL_IF_SET (decl);
+
+ do_var_decl:
+ if (!decl_rtl)
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
+
/* If the variable is really a constant
and not written in memory, inform the debugger.
@@ -2649,13 +2660,13 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
}
/* else it is something we handle like a normal variable. */
- SET_DECL_RTL (decl, eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
+ decl_rtl = eliminate_regs (decl_rtl, 0, NULL_RTX);
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
- leaf_renumber_regs_insn (DECL_RTL (decl));
+ leaf_renumber_regs_insn (decl_rtl);
#endif
- result = dbxout_symbol_location (decl, type, 0, DECL_RTL (decl));
+ result = dbxout_symbol_location (decl, type, 0, decl_rtl);
break;
default: