aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2007-07-24 18:32:48 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2007-07-24 18:32:48 +0000
commitb21a6ea1002424fcb2b3d5d5661526ce7abbb358 (patch)
treeaef27a7a65a4638abb1d5356e2275abff2db0140 /gcc/cp
parentfd8e2796db2f85f00d5d847088a714f547737360 (diff)
downloadgcc-b21a6ea1002424fcb2b3d5d5661526ce7abbb358.zip
gcc-b21a6ea1002424fcb2b3d5d5661526ce7abbb358.tar.gz
gcc-b21a6ea1002424fcb2b3d5d5661526ce7abbb358.tar.bz2
method.c (implicitly_declare_fn): Increase alignment if member function pointer format requires it.
* method.c (implicitly_declare_fn): Increase alignment if member function pointer format requires it. From-SVN: r126884
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/method.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f0ea30b..456e587 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * method.c (implicitly_declare_fn): Increase alignment if member
+ function pointer format requires it.
+
2007-07-24 Paolo Carlini <pcarlini@suse.de>
PR c++/29001
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 03f4908..543bb5f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1078,6 +1078,14 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
DECL_ASSIGNMENT_OPERATOR_P (fn) = 1;
SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR);
}
+
+ /* 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
+ && DECL_ALIGN (fn) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (fn) = 2 * BITS_PER_UNIT;
+
/* Create the explicit arguments. */
if (rhs_parm_type)
{