summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-05 12:25:26 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-05 12:25:26 +0000
commit66d12a6c0042f50195e3775da6684f7455019f15 (patch)
tree7cf8c66a6e9e97bafc971ed6abd2828df8113d1e /gcc/cp
parent9608068808c1ecf65647ea53ba0d340467302e34 (diff)
downloadgcc-66d12a6c0042f50195e3775da6684f7455019f15.tar.gz
* c-decl.c (build_compound_literal): Use TYPE_READONLY.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * objc/objc-act.c (adorn_decl, gen_declspecs): Likewise. * c-typeck.c (decl_constant_value): Don't access DECL_INITIAL of a PARM_DECL. * calls.c (flags_from_decl_or_type): Use TYPE_READONLY and do so only for a type. * print-tree.c (print_node): Properly handle side-effects, readonly, and constant flags. * tree.c (build1_stat, build_expr_wfl): Only look at TREE_SIDE_EFFECTS and TREE_CONSTANT if not a type. * tree.h (IS_NON_TYPE_CODE_CLASS): New macro. (IS_EXPR_CODE_CLASS): Write 'E', not 'e'. (NON_TYPE_CHECK): New macro. (TREE_SIDE_EFFECT, TREE_READONLY, TREE_CONSTANT: Add check. * cp/init.c (decl_constant_value): Don't look at DECL_INITIAL of PARM_DECL. * cp/tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT or TREE_SIDE_EFFECTS of a type. * ada/decl.c (gnat_to_gnu_entity): Use TYPE_READONLY. * ada/utils.c (create_field_decl): Likewise. * ada/utils2.c (build_unary_op, gnat_build_constructor): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80430 138bc75d-0d04-0410-961f-82ee72b054a4
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;
}