From d94a3bb75943d7dec3b25b8baf496161654a0abf Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 24 Jul 2007 18:32:48 +0000 Subject: [PATCH] * method.c (implicitly_declare_fn): Increase alignment if member function pointer format requires it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126884 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/method.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f0ea30b7a8b..456e5878790 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2007-07-24 Nathan Sidwell + + * method.c (implicitly_declare_fn): Increase alignment if member + function pointer format requires it. + 2007-07-24 Paolo Carlini PR c++/29001 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 03f49088451..543bb5fa12d 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) { -- 2.11.4.GIT