aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-04-05 12:25:26 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-04-05 08:25:26 -0400
commit4f976745b7f4deeed63381e21990fd2a2c2e2103 (patch)
tree7cf8c66a6e9e97bafc971ed6abd2828df8113d1e /gcc/tree.c
parent5ffc47306c2e13f9d65d98f2a6fd3ea277945ce5 (diff)
downloadgcc-4f976745b7f4deeed63381e21990fd2a2c2e2103.zip
gcc-4f976745b7f4deeed63381e21990fd2a2c2e2103.tar.gz
gcc-4f976745b7f4deeed63381e21990fd2a2c2e2103.tar.bz2
c-decl.c (build_compound_literal): Use TYPE_READONLY.
* 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. From-SVN: r80430
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 7d5e6d5..205db3f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2402,7 +2402,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
TREE_TYPE (t) = type;
TREE_COMPLEXITY (t) = 0;
TREE_OPERAND (t, 0) = node;
- if (node && first_rtl_op (code) != 0)
+ if (node && !TYPE_P (node) && first_rtl_op (code) != 0)
{
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node);
TREE_READONLY (t) = TREE_READONLY (node);
@@ -2456,7 +2456,8 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
break;
default:
- if (TREE_CODE_CLASS (code) == '1' && node && TREE_CONSTANT (node))
+ if (TREE_CODE_CLASS (code) == '1' && node && !TYPE_P (node)
+ && TREE_CONSTANT (node))
TREE_CONSTANT (t) = 1;
break;
}
@@ -2467,7 +2468,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
#define PROCESS_ARG(N) \
do { \
TREE_OPERAND (t, N) = arg##N; \
- if (arg##N && fro > N) \
+ if (arg##N &&!TYPE_P (arg##N) && fro > N) \
{ \
if (TREE_SIDE_EFFECTS (arg##N)) \
side_effects = 1; \
@@ -2742,7 +2743,8 @@ build_expr_wfl (tree node, const char *file, int line, int col)
}
EXPR_WFL_FILENAME_NODE (wfl) = last_filenode;
- if (node)
+
+ if (node && !TYPE_P (node))
{
TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
TREE_TYPE (wfl) = TREE_TYPE (node);