GCC modified for the FreeChainXenon project
Find a file
Kewen Lin 165b1f6ad1 targhooks: Extend legitimate_address_p with code_helper [PR110248]
As PR110248 shows, some middle-end passes like IVOPTs can
query the target hook legitimate_address_p with some
artificially constructed rtx to determine whether some
addressing modes are supported by target for some gimple
statement.  But for now the existing legitimate_address_p
only checks the given mode, it's unable to distinguish
some special cases unfortunately, for example, for LEN_LOAD
ifn on Power port, we would expand it with lxvl hardware
insn, which only supports one register to hold the address
(the other register is holding the length), that is we
don't support base (reg) + index (reg) addressing mode for
sure.  But hook legitimate_address_p only considers the
given mode which would be some vector mode for LEN_LOAD
ifn, and we do support base + index addressing mode for
normal vector load and store insns, so the hook will return
true for the query unexpectedly.

This patch is to introduce one extra argument of type
code_helper for hook legitimate_address_p, it makes targets
able to handle some special case like what's described
above.

	PR tree-optimization/110248

gcc/ChangeLog:

	* coretypes.h (class code_helper): Add forward declaration.
	* doc/tm.texi: Regenerate.
	* lra-constraints.cc (valid_address_p): Call target hook
	targetm.addr_space.legitimate_address_p with an extra parameter
	ERROR_MARK as its prototype changes.
	* recog.cc (memory_address_addr_space_p): Likewise.
	* reload.cc (strict_memory_address_addr_space_p): Likewise.
	* target.def (legitimate_address_p, addr_space.legitimate_address_p):
	Extend with one more argument of type code_helper, update the
	documentation accordingly.
	* targhooks.cc (default_legitimate_address_p): Adjust for the
	new code_helper argument.
	(default_addr_space_legitimate_address_p): Likewise.
	* targhooks.h (default_legitimate_address_p): Likewise.
	(default_addr_space_legitimate_address_p): Likewise.
	* config/aarch64/aarch64.cc (aarch64_legitimate_address_hook_p): Adjust
	with extra unnamed code_helper argument with default ERROR_MARK.
	* config/alpha/alpha.cc (alpha_legitimate_address_p): Likewise.
	* config/arc/arc.cc (arc_legitimate_address_p): Likewise.
	* config/arm/arm-protos.h (arm_legitimate_address_p): Likewise.
	(tree.h): New include for tree_code ERROR_MARK.
	* config/arm/arm.cc (arm_legitimate_address_p): Adjust with extra
	unnamed code_helper argument with default ERROR_MARK.
	* config/avr/avr.cc (avr_addr_space_legitimate_address_p): Likewise.
	* config/bfin/bfin.cc (bfin_legitimate_address_p): Likewise.
	* config/bpf/bpf.cc (bpf_legitimate_address_p): Likewise.
	* config/c6x/c6x.cc (c6x_legitimate_address_p): Likewise.
	* config/cris/cris-protos.h (cris_legitimate_address_p): Likewise.
	(tree.h): New include for tree_code ERROR_MARK.
	* config/cris/cris.cc (cris_legitimate_address_p): Adjust with extra
	unnamed code_helper argument with default ERROR_MARK.
	* config/csky/csky.cc (csky_legitimate_address_p): Likewise.
	* config/epiphany/epiphany.cc (epiphany_legitimate_address_p):
	Likewise.
	* config/frv/frv.cc (frv_legitimate_address_p): Likewise.
	* config/ft32/ft32.cc (ft32_addr_space_legitimate_address_p): Likewise.
	* config/gcn/gcn.cc (gcn_addr_space_legitimate_address_p): Likewise.
	* config/h8300/h8300.cc (h8300_legitimate_address_p): Likewise.
	* config/i386/i386.cc (ix86_legitimate_address_p): Likewise.
	* config/ia64/ia64.cc (ia64_legitimate_address_p): Likewise.
	* config/iq2000/iq2000.cc (iq2000_legitimate_address_p): Likewise.
	* config/lm32/lm32.cc (lm32_legitimate_address_p): Likewise.
	* config/loongarch/loongarch.cc (loongarch_legitimate_address_p):
	Likewise.
	* config/m32c/m32c.cc (m32c_legitimate_address_p): Likewise.
	(m32c_addr_space_legitimate_address_p): Likewise.
	* config/m32r/m32r.cc (m32r_legitimate_address_p): Likewise.
	* config/m68k/m68k.cc (m68k_legitimate_address_p): Likewise.
	* config/mcore/mcore.cc (mcore_legitimate_address_p): Likewise.
	* config/microblaze/microblaze-protos.h (tree.h): New include for
	tree_code ERROR_MARK.
	(microblaze_legitimate_address_p): Adjust with extra unnamed
	code_helper argument with default ERROR_MARK.
	* config/microblaze/microblaze.cc (microblaze_legitimate_address_p):
	Likewise.
	* config/mips/mips.cc (mips_legitimate_address_p): Likewise.
	* config/mmix/mmix.cc (mmix_legitimate_address_p): Likewise.
	* config/mn10300/mn10300.cc (mn10300_legitimate_address_p): Likewise.
	* config/moxie/moxie.cc (moxie_legitimate_address_p): Likewise.
	* config/msp430/msp430.cc (msp430_legitimate_address_p): Likewise.
	(msp430_addr_space_legitimate_address_p): Adjust with extra code_helper
	argument with default ERROR_MARK and adjust the call to function
	msp430_legitimate_address_p.
	* config/nds32/nds32.cc (nds32_legitimate_address_p): Adjust with extra
	unnamed code_helper argument with default ERROR_MARK.
	* config/nios2/nios2.cc (nios2_legitimate_address_p): Likewise.
	* config/nvptx/nvptx.cc (nvptx_legitimate_address_p): Likewise.
	* config/or1k/or1k.cc (or1k_legitimate_address_p): Likewise.
	* config/pa/pa.cc (pa_legitimate_address_p): Likewise.
	* config/pdp11/pdp11.cc (pdp11_legitimate_address_p): Likewise.
	* config/pru/pru.cc (pru_addr_space_legitimate_address_p): Likewise.
	* config/riscv/riscv.cc (riscv_legitimate_address_p): Likewise.
	* config/rl78/rl78-protos.h (rl78_as_legitimate_address): Likewise.
	(tree.h): New include for tree_code ERROR_MARK.
	* config/rl78/rl78.cc (rl78_as_legitimate_address): Adjust with
	extra unnamed code_helper argument with default ERROR_MARK.
	* config/rs6000/rs6000.cc (rs6000_legitimate_address_p): Likewise.
	(rs6000_debug_legitimate_address_p): Adjust with extra code_helper
	argument and adjust the call to function rs6000_legitimate_address_p.
	* config/rx/rx.cc (rx_is_legitimate_address): Adjust with extra
	unnamed code_helper argument with default ERROR_MARK.
	* config/s390/s390.cc (s390_legitimate_address_p): Likewise.
	* config/sh/sh.cc (sh_legitimate_address_p): Likewise.
	* config/sparc/sparc.cc (sparc_legitimate_address_p): Likewise.
	* config/v850/v850.cc (v850_legitimate_address_p): Likewise.
	* config/vax/vax.cc (vax_legitimate_address_p): Likewise.
	* config/visium/visium.cc (visium_legitimate_address_p): Likewise.
	* config/xtensa/xtensa.cc (xtensa_legitimate_address_p): Likewise.
	* config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p):
	Likewise.
	(tree.h): New include for tree_code ERROR_MARK.
	* config/stormy16/stormy16.cc (xstormy16_legitimate_address_p):
	Adjust with extra unnamed code_helper argument with default
	ERROR_MARK.
2023-08-09 01:16:05 -05:00
c++tools Daily bump. 2023-06-23 00:16:38 +00:00
config Daily bump. 2023-08-08 00:17:37 +00:00
contrib Daily bump. 2023-07-14 00:16:43 +00:00
fixincludes Daily bump. 2023-08-08 00:17:37 +00:00
gcc targhooks: Extend legitimate_address_p with code_helper [PR110248] 2023-08-09 01:16:05 -05:00
gnattools Daily bump. 2023-04-26 00:17:46 +00:00
gotools
include Daily bump. 2023-08-08 00:17:37 +00:00
INSTALL
intl Daily bump. 2023-08-08 00:17:37 +00:00
libada Daily bump. 2023-08-08 00:17:37 +00:00
libatomic Daily bump. 2023-08-08 00:17:37 +00:00
libbacktrace Daily bump. 2023-08-08 00:17:37 +00:00
libcc1 Daily bump. 2023-08-08 00:17:37 +00:00
libcody Daily bump. 2023-06-16 00:17:18 +00:00
libcpp Daily bump. 2023-08-08 00:17:37 +00:00
libdecnumber Daily bump. 2023-06-16 00:17:18 +00:00
libffi Daily bump. 2023-08-08 00:17:37 +00:00
libgcc Daily bump. 2023-08-08 00:17:37 +00:00
libgfortran Daily bump. 2023-08-08 00:17:37 +00:00
libgm2 Daily bump. 2023-08-08 00:17:37 +00:00
libgo cmd/go: don't collect package CGOLDFLAGS when using gccgo 2023-07-20 12:29:11 -07:00
libgomp Daily bump. 2023-08-08 00:17:37 +00:00
libiberty Daily bump. 2023-08-08 00:17:37 +00:00
libitm Daily bump. 2023-08-08 00:17:37 +00:00
libobjc Daily bump. 2023-08-08 00:17:37 +00:00
libphobos Daily bump. 2023-08-08 00:17:37 +00:00
libquadmath Daily bump. 2023-08-08 00:17:37 +00:00
libsanitizer Daily bump. 2023-08-08 00:17:37 +00:00
libssp Daily bump. 2023-08-08 00:17:37 +00:00
libstdc++-v3 Daily bump. 2023-08-08 00:17:37 +00:00
libvtv Daily bump. 2023-08-08 00:17:37 +00:00
lto-plugin Daily bump. 2023-08-08 00:17:37 +00:00
maintainer-scripts Daily bump. 2023-07-08 00:16:53 +00:00
zlib Daily bump. 2023-08-08 00:17:37 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-08-08 00:17:37 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Add support for the haiku operating system 2023-08-07 22:59:40 +02:00
configure.ac Add support for the haiku operating system 2023-08-07 22:59:40 +02:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 libtool.m4: augment symcode for Solaris 11 2023-08-07 22:59:41 +02:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself as a BPF port reviewer 2023-08-07 10:26:38 -07:00
Makefile.def toplevel: Makefile.def: add install-strip dependency on libsframe 2023-08-07 22:59:42 +02:00
Makefile.in toplevel: Makefile.def: add install-strip dependency on libsframe 2023-08-07 22:59:42 +02:00
Makefile.tpl Pass PKG_CONFIG_PATH down from top-level Makefile 2023-08-07 22:59:38 +02: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.