[committed] d: Align methods to MINIMUM_METHOD_BOUNDARY.

Message ID 20211210011655.64402-1-ibuclaw@gdcproject.org
State Committed
Headers
Series [committed] d: Align methods to MINIMUM_METHOD_BOUNDARY. |

Commit Message

Iain Buclaw Dec. 10, 2021, 1:16 a.m. UTC
  Hi,

This patch aligns all D defined methods to MINIMUM_METHOD_BOUNDARY,
improving interoperability with C++ methods.

Bootstrapped and regression tested on x86_64-linux-gnu, committed to
mainline and backported to the release branches.

Regards,
Iain.

gcc/d/ChangeLog:

	* decl.cc (get_symbol_decl): Align methods to MINIMUM_METHOD_BOUNDARY.
---
 gcc/d/decl.cc | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index a4976b68bf0..55c65759d65 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1248,6 +1248,9 @@  get_symbol_decl (Declaration *decl)
 	      DECL_VINDEX (decl->csym) = size_int (fd->vtblIndex);
 	      DECL_VIRTUAL_P (decl->csym) = 1;
 	    }
+
+	  /* Align method to the specified target boundary.  */
+	  SET_DECL_ALIGN (decl->csym, MINIMUM_METHOD_BOUNDARY);
 	}
       else if (fd->isMain () || fd->isCMain ())
 	{