Go to file
Christophe Lyon 3df1a115be aarch64: fix warning emission for ABI break since GCC 9.1
While looking at PR 105549, which is about fixing the ABI break
introduced in GCC 9.1 in parameter alignment with bit-fields, we
noticed that the GCC 9.1 warning is not emitted in all the cases where
it should be.  This patch fixes that and the next patch in the series
fixes the GCC 9.1 break.

We split this into two patches since patch #2 introduces a new ABI
break starting with GCC 13.1.  This way, patch #1 can be back-ported
to release branches if needed to fix the GCC 9.1 warning issue.

The main idea is to add a new global boolean that indicates whether
we're expanding the start of a function, so that aarch64_layout_arg
can emit warnings for callees as well as callers.  This removes the
need for aarch64_function_arg_boundary to warn (with its incomplete
information).  However, in the first patch there are still cases where
we emit warnings were we should not; this is fixed in patch #2 where
we can distinguish between GCC 9.1 and GCC.13.1 ABI breaks properly.

The fix in aarch64_function_arg_boundary (replacing & with &&) looks
like an oversight of a previous commit in this area which changed
'abi_break' from a boolean to an integer.

We also take the opportunity to fix the comment above
aarch64_function_arg_alignment since the value of the abi_break
parameter was changed in a previous commit, no longer matching the
description.

2022-11-28  Christophe Lyon  <christophe.lyon@arm.com>
	    Richard Sandiford  <richard.sandiford@arm.com>

gcc/ChangeLog:

	* config/aarch64/aarch64.cc (aarch64_function_arg_alignment): Fix
	comment.
	(aarch64_layout_arg): Factorize warning conditions.
	(aarch64_function_arg_boundary): Fix typo.
	* function.cc (currently_expanding_function_start): New variable.
	(expand_function_start): Handle
	currently_expanding_function_start.
	* function.h (currently_expanding_function_start): Declare.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/bitfield-abi-warning-align16-O2.c: New test.
	* gcc.target/aarch64/bitfield-abi-warning-align16-O2-extra.c: New
	test.
	* gcc.target/aarch64/bitfield-abi-warning-align32-O2.c: New test.
	* gcc.target/aarch64/bitfield-abi-warning-align32-O2-extra.c: New
	test.
	* gcc.target/aarch64/bitfield-abi-warning-align8-O2.c: New test.
	* gcc.target/aarch64/bitfield-abi-warning.h: New test.
	* g++.target/aarch64/bitfield-abi-warning-align16-O2.C: New test.
	* g++.target/aarch64/bitfield-abi-warning-align16-O2-extra.C: New
	test.
	* g++.target/aarch64/bitfield-abi-warning-align32-O2.C: New test.
	* g++.target/aarch64/bitfield-abi-warning-align32-O2-extra.C: New
	test.
	* g++.target/aarch64/bitfield-abi-warning-align8-O2.C: New test.
	* g++.target/aarch64/bitfield-abi-warning.h: New test.
2023-01-12 14:42:00 +01:00
c++tools Daily bump. 2023-01-10 00:18:07 +00:00
config
contrib Daily bump. 2023-01-12 00:18:07 +00:00
fixincludes Daily bump. 2022-11-24 00:17:47 +00:00
gcc aarch64: fix warning emission for ABI break since GCC 9.1 2023-01-12 14:42:00 +01:00
gnattools
gotools
include Daily bump. 2022-12-22 00:17:29 +00:00
INSTALL
intl Daily bump. 2022-11-24 00:17:47 +00:00
libada Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libatomic Daily bump. 2023-01-08 00:16:59 +00:00
libbacktrace Daily bump. 2023-01-07 00:17:28 +00:00
libcc1
libcody Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libcpp Daily bump. 2023-01-10 00:18:07 +00:00
libdecnumber Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libffi Daily bump. 2023-01-08 00:16:59 +00:00
libgcc Daily bump. 2023-01-08 00:16:59 +00:00
libgfortran Daily bump. 2023-01-08 00:16:59 +00:00
libgm2 Daily bump. 2023-01-07 00:17:28 +00:00
libgo Always define WIN32_LEAN_AND_MEAN before <windows.h> 2023-01-07 06:51:06 +00:00
libgomp Daily bump. 2023-01-08 00:16:59 +00:00
libiberty Daily bump. 2023-01-08 00:16:59 +00:00
libitm Daily bump. 2023-01-03 00:17:09 +00:00
libobjc Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libphobos Update Copyright year in ChangeLog files 2023-01-02 09:23:36 +01:00
libquadmath Daily bump. 2023-01-03 00:17:09 +00:00
libsanitizer Daily bump. 2022-12-20 00:17:00 +00:00
libssp Daily bump. 2023-01-08 00:16:59 +00:00
libstdc++-v3 libstdc++: Use lock-free type for __platform_wait_t 2023-01-12 11:01:09 +00:00
libvtv Daily bump. 2023-01-08 00:16:59 +00:00
lto-plugin Daily bump. 2022-11-24 00:17:47 +00:00
maintainer-scripts Daily bump. 2022-12-01 00:17:51 +00:00
zlib Daily bump. 2022-11-24 00:17:47 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-01-11 00:17:56 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure configure: remove dependencies on gmp and mpfr when gdb is disabled 2023-01-06 09:36:52 +01:00
configure.ac configure: remove dependencies on gmp and mpfr when gdb is disabled 2023-01-06 09:36:52 +01:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Add myself as Rust front-end maintainer 2023-01-10 22:06:09 +00:00
Makefile.def configure: Do not build the ununsed libffi shared library. 2022-12-31 17:51:47 +00:00
Makefile.in configure: Do not build the ununsed libffi shared library. 2022-12-31 17:51:47 +00:00
Makefile.tpl Merge modula-2 front end onto gcc. 2022-12-14 17:43:08 +00:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

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.