aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog7
-rw-r--r--gcc/java/class.c8
-rw-r--r--gcc/java/lang.c7
3 files changed, 15 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 87a0113..f60c2bd 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-09 Geoffrey Keating <geoffk@apple.com>
+
+ PR 32617
+ * lang.c (java_init): Remove setting of force_align_functions_log.
+ * class.c (add_method_1): Set DECL_ALIGN of non-static method
+ to cope with ptrmemfunc_vbit_in_pfn.
+
2007-07-03 David Daney <ddaney@avtrex.com>
* java/Make-lang.in (doc/gcj.info): Add $(gcc_docdir) to
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 3d43726..bbfe4f2 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -725,6 +725,14 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
TREE_CHAIN (fndecl) = TYPE_METHODS (this_class);
TYPE_METHODS (this_class) = fndecl;
+ /* If pointers to member functions use the least significant bit to
+ indicate whether a function is virtual, ensure a pointer
+ to this function will have that bit clear. */
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && !(access_flags & ACC_STATIC)
+ && DECL_ALIGN (fndecl) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (fndecl) = 2 * BITS_PER_UNIT;
+
/* Notice that this is a finalizer and update the class type
accordingly. This is used to optimize instance allocation. */
if (name == finalize_identifier_node
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 7fd6fcd..6a57cd2 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -355,13 +355,6 @@ java_init (void)
if (!flag_indirect_dispatch)
flag_indirect_classes = false;
- /* Force minimum function alignment if g++ uses the least significant
- bit of function pointers to store the virtual bit. This is required
- to keep vtables compatible. */
- if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
- && force_align_functions_log < 1)
- force_align_functions_log = 1;
-
jcf_path_seal (v_flag);
java_init_decl_processing ();