From b798d8b64db189b0d3481263de714817ede0e4ce Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Wed, 17 Apr 2002 23:13:11 +0000 Subject: [PATCH] class.c (make_class_data): Set DECL_ALIGN on static class data, for hash synchronization. * class.c (make_class_data): Set DECL_ALIGN on static class data, for hash synchronization. * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects. * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for class_type_node. From-SVN: r52448 --- gcc/java/ChangeLog | 8 ++++++++ gcc/java/class.c | 5 +++++ gcc/java/decl.c | 4 ---- gcc/java/expr.c | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 2666603aabf..db10f95777d 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2002-04-18 Bryce McKinlay + + * class.c (make_class_data): Set DECL_ALIGN on static class data, + for hash synchronization. + * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects. + * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for + class_type_node. + 2002-04-16 Mark Wielaard * jcf-write.c (generate_bytecode_insns): Only write const_0 if not diff --git a/gcc/java/class.c b/gcc/java/class.c index c8290eabf2b..7b8c5e06c3a 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1736,6 +1736,11 @@ make_class_data (type) FINISH_RECORD_CONSTRUCTOR (cons); DECL_INITIAL (decl) = cons; + + /* Hash synchronization requires at least 64-bit alignment. */ + if (flag_hash_synchronization && POINTER_SIZE < 64) + DECL_ALIGN (decl) = 64; + rest_of_decl_compilation (decl, (char*) 0, 1, 0); } diff --git a/gcc/java/decl.c b/gcc/java/decl.c index c0560c6dbb7..c3dd5ae67d4 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -682,10 +682,6 @@ java_init_decl_processing () FIELD_PRIVATE (t) = 1; push_super_field (class_type_node, object_type_node); - /* Hash synchronization requires at least double-word alignment. */ - if (flag_hash_synchronization && POINTER_SIZE < 64) - TYPE_ALIGN (class_type_node) = 64; - FINISH_RECORD (class_type_node); build_decl (TYPE_DECL, get_identifier ("Class"), class_type_node); diff --git a/gcc/java/expr.c b/gcc/java/expr.c index bba81d5e683..dd736c77d00 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -2526,6 +2526,9 @@ java_expand_expr (exp, target, tmode, modifier) DECL_INITIAL (init_decl) = value; DECL_IGNORED_P (init_decl) = 1; TREE_READONLY (init_decl) = 1; + /* Hash synchronization requires at least 64-bit alignment. */ + if (flag_hash_synchronization && POINTER_SIZE < 64) + DECL_ALIGN (init_decl) = 64; rest_of_decl_compilation (init_decl, NULL, 1, 0); TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1; init = build1 (ADDR_EXPR, TREE_TYPE (exp), init_decl); -- 2.30.2