Gaius Mulley d286ece094 PR modula2/118600 Assigning to a record causes alignment exception
This patch recursively tests every assignment (of a constructor
to a designator) to ensure the types are GCC equivalent.  If they
are equivalent then it uses gimple assignment and if not then it
copies a structure by field and uses __builtin_strncpy to copy a
string cst into an array.  Unions are copied by __builtin_memcpy.

gcc/m2/ChangeLog:

	PR modula2/118600
	* gm2-compiler/M2GenGCC.mod (PerformCodeBecomes): New procedure.
	(CodeBecomes): Refactor and call PerformCodeBecomes.
	* gm2-gcc/m2builtins.cc (gm2_strncpy_node): New global variable.
	(DoBuiltinStrNCopy): New function.
	(m2builtins_BuiltinStrNCopy): New function.
	(m2builtins_init): Initialize gm2_strncpy_node.
	* gm2-gcc/m2builtins.def (BuiltinStrNCopy): New procedure
	function.
	* gm2-gcc/m2builtins.h (m2builtins_BuiltinStrNCopy): New
	function.
	* gm2-gcc/m2statement.cc (copy_record_fields): New function.
	(copy_array): Ditto.
	(copy_strncpy): Ditto.
	(copy_memcpy): Ditto.
	(CopyByField_Lower): Ditto.
	(m2statement_CopyByField): Ditto.
	* gm2-gcc/m2statement.def (CopyByField): New procedure function.
	* gm2-gcc/m2statement.h (m2statement_CopyByField): New function.
	* gm2-gcc/m2type.cc (check_record_fields): Ditto.
	(check_array_types): Ditto.
	(m2type_IsGccStrictTypeEquivalent): Ditto.
	* gm2-gcc/m2type.def (IsGccStrictTypeEquivalent): New procedure
	function.
	* gm2-gcc/m2type.h (m2type_IsAddress): Replace return type int
	with bool.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2025-03-20 20:10:31 +00:00
2025-01-02 11:59:57 +01:00
2025-03-18 00:19:44 +00:00
2025-03-19 00:17:56 +00:00
2025-01-02 11:59:57 +01:00
2025-01-11 00:19:49 +00:00
2025-02-11 00:17:27 +00:00
2025-01-02 11:59:57 +01:00
2025-03-20 17:30:54 +00:00
2025-01-02 11:59:57 +01:00
2025-03-15 00:17:37 +00:00
2025-02-28 00:16:37 +00:00
2025-03-18 00:19:44 +00:00
2025-03-18 00:19:44 +00:00
2025-03-19 00:17:56 +00:00
2025-01-03 00:17:15 +00:00
2025-01-02 11:59:57 +01:00
2025-03-19 00:17:56 +00:00
2025-01-03 00:17:15 +00:00
2025-01-07 00:18:08 +00:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-03-07 00:17:19 +00:00
2025-03-12 00:18:35 +00:00
2025-03-18 00:19:44 +00:00
2025-03-11 07:48:27 +01:00
2025-03-11 07:48:27 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.8%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.3%