summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/init.c1
-rw-r--r--gcc/cp/tree.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 73aa9144902..515f6feb9b3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * init.c (decl_constant_value): Don't look at DECL_INITIAL
+ of PARM_DECL.
+ * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
+ or TREE_SIDE_EFFECTS of a type.
+
2004-04-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/14007
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index efc9a1323e1..e9142b775e0 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1623,6 +1623,7 @@ decl_constant_value (tree decl)
/* And so are variables with a 'const' type -- unless they
are also 'volatile'. */
|| CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl)))
+ && TREE_CODE (decl) != PARM_DECL
&& DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node
/* This is invalid if initial value is not constant.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index adf3b391114..8dd85eae80d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1186,7 +1186,7 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
splay_tree target_remap = ((splay_tree) data);
tree t = *tp;
- if (TREE_CONSTANT (t))
+ if (!TYPE_P (t) && TREE_CONSTANT (t))
{
/* There can't be any TARGET_EXPRs or their slot variables below
this point. We used to check !TREE_SIDE_EFFECTS, but then we
@@ -1327,7 +1327,7 @@ build_min (enum tree_code code, tree tt, ...)
{
tree x = va_arg (p, tree);
TREE_OPERAND (t, i) = x;
- if (x && TREE_SIDE_EFFECTS (x))
+ if (x && !TYPE_P (x) && TREE_SIDE_EFFECTS (x))
TREE_SIDE_EFFECTS (t) = 1;
}