Go to file
David Malcolm 9a385c2d3d Implement CALL_EXPR_MUST_TAIL_CALL
This patch implements support for marking CALL_EXPRs
as being mandatory for tail-call-optimization. expand_call
tries harder to perform the optimization on such CALL_EXPRs,
and issues an error if it fails.

Currently this flag isn't accessible from any frontend,
so the patch uses a plugin for testing the functionality.

gcc/ChangeLog:
	* calls.c (maybe_complain_about_tail_call): New function.
	(initialize_argument_information): Call
	maybe_complain_about_tail_call when clearing *may_tailcall.
	(can_implement_as_sibling_call_p): Call
	maybe_complain_about_tail_call when returning false.
	(expand_call): Read CALL_EXPR_MUST_TAIL_CALL and, if set,
	ensure try_tail_call is set.  Call maybe_complain_about_tail_call
	if tail-call optimization fails.
	* cfgexpand.c (expand_call_stmt): Initialize
	CALL_EXPR_MUST_TAIL_CALL from gimple_call_must_tail_p.
	* gimple-pretty-print.c (dump_gimple_call): Dump
	gimple_call_must_tail_p.
	* gimple.c (gimple_build_call_from_tree): Call
	gimple_call_set_must_tail with the value of
	CALL_EXPR_MUST_TAIL_CALL.
	* gimple.h (enum gf_mask): Add GF_CALL_MUST_TAIL_CALL.
	(gimple_call_set_must_tail): New function.
	(gimple_call_must_tail_p): New function.
	* print-tree.c (print_node): Update printing of TREE_STATIC
	to reflect its use for CALL_EXPR_MUST_TAIL_CALL.
	* tree-core.h (struct tree_base): Add MUST_TAIL_CALL to the
	trailing comment listing applicable flags.
	* tree.h (CALL_EXPR_MUST_TAIL_CALL): New macro.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/must-tail-call-1.c: New test case.
	* gcc.dg/plugin/must-tail-call-2.c: New test case.
	* gcc.dg/plugin/must_tail_call_plugin.c: New file.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the above.

From-SVN: r236514
2016-05-20 14:20:03 +00:00
INSTALL README: Do not mention CVS. 2014-10-12 15:05:28 +00:00
boehm-gc [Hurd, kFreeBSD] boehm-gc: Use mmap instead of brk 2016-03-29 23:05:07 +02:00
config config.guess: Remove SH5 support. 2016-04-30 09:11:03 +00:00
contrib configure.ac (mpfr): Remove pre-3.1.0 mpfr compatibility code. 2016-05-02 15:23:20 +00:00
fixincludes re PR target/68741 (FAIL: tr1/8_c_compatibility/cstdio/functions.cc (test for excess errors)) 2016-02-01 00:54:22 +00:00
gcc Implement CALL_EXPR_MUST_TAIL_CALL 2016-05-20 14:20:03 +00:00
gnattools configure.ac: Add ACX_NONCANONICAL_HOST. 2016-05-16 08:55:12 +00:00
gotools libgo: Update to go1.6rc1. 2016-02-03 21:58:02 +00:00
include Move ChangeLog entry to the right file. 2016-05-19 11:55:01 +02:00
intl Makefile.def (libiconv): Define bootstrap=true. 2015-08-07 01:13:52 -04:00
libada config.guess: Remove SH5 support. 2016-04-30 09:11:03 +00:00
libatomic [libatomic] Add missing files for RTEMS support 2016-05-10 06:52:48 +00:00
libbacktrace re PR target/71161 (Lots of ASAN and libgo runtime FAILs after r236090) 2016-05-18 16:40:54 +02:00
libcc1 tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. 2016-04-18 20:36:27 +00:00
libcilkrts configure.ac: Move AC_USE_SYSTEM_EXTENSIONS behind AM_ENABLE_MULTILIB. 2016-05-10 16:44:19 +00:00
libcpp Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
libdecnumber Update copyright years. 2016-01-04 15:30:50 +01:00
libffi Summary: libffi: define FFI_SIZEOF_JAVA_RAW for aarch64 ILP32 2016-03-17 10:47:58 +00:00
libgcc cygming.h (DWARF2_UNWIND_INFO): Allow --disable-sjlj-exceptions for TARGET_BI_ARCH to select DWARF-2 EH for... 2016-05-19 17:59:45 -04:00
libgfortran re PR libfortran/70684 (incorrect reading of values from file on Windows) 2016-04-19 19:24:28 +00:00
libgo cmd/go: bring in final version of gccgo pkg-config support 2016-04-23 00:41:03 +00:00
libgomp oacc-init.c (acc_init): Remove !cached_base_dev condition on call to gomp_init_targets_once. 2016-05-17 08:07:52 +00:00
libiberty Move ChangeLog entry to the right file. 2016-05-19 11:55:01 +02:00
libitm Allocate memory on cache line if requested 2016-04-19 10:01:11 -07:00
libjava config.guess: Revert r235676. 2016-04-30 10:26:14 +00:00
libmpx libtool-version: Remove. 2016-01-21 00:17:37 +00:00
libobjc Update copyright years. 2016-01-04 15:30:50 +01:00
liboffloadmic libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_run): Pass extra NULL to GOMP_OFFLOAD_async_run. 2016-01-20 13:40:22 +00:00
libquadmath gcc.c (process_command): Update copyright notice dates. 2016-01-04 14:03:35 +01:00
libsanitizer re PR sanitizer/71160 (libasan: Backport support for malloc within dlsym) 2016-05-17 11:17:54 +02:00
libssp re PR target/65867 (bootstrap fails for mingw32 due to missing header in ssp.c) 2016-02-09 12:16:30 -07:00
libstdc++-v3 re PR libstdc++/71081 (experimental/memory_resource/1.cc run for targets without atomics) 2016-05-20 12:36:57 +00:00
libvtv Don't install libvtv without --enable-vtable-verify 2016-05-02 18:10:17 +00:00
lto-plugin re PR driver/68463 (Offloading fails when some objects are compiled with LTO and some without) 2016-02-25 12:23:52 +00:00
maintainer-scripts * crontab: Enable snapshots from gcc-6-branch. 2016-04-15 17:33:15 +02:00
zlib 2015-11-23 Matthias Klose <doko@ubuntu.com> 2015-11-23 20:27:57 +00:00
.dir-locals.el * .dir-locals.el: Add. 2013-10-16 18:25:31 +00:00
.gitattributes add basic .gitattributes files to notice whitespace issues 2016-04-23 02:37:43 +00:00
.gitignore Add clang-format config to contrib folder 2015-11-19 12:32:09 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog config.guess: Import version 2016-04-02 (newest). 2016-05-16 16:13:37 -06:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS (Write After Approval): Add myself. 2016-05-09 08:59:46 -05:00
Makefile.def configure.ac (mpfr): Remove pre-3.1.0 mpfr compatibility code. 2016-05-02 15:23:20 +00:00
Makefile.in configure.ac (mpfr): Remove pre-3.1.0 mpfr compatibility code. 2016-05-02 15:23:20 +00:00
Makefile.tpl Make distclean clean up more (PR70173) 2016-04-13 20:02:08 +02:00
README
compile Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
config-ml.in re PR other/66259 (Combined gcc and binutils build from git-master fails, with gas/as-new not existing) 2015-07-24 12:20:44 -06:00
config.guess config.guess: Import version 2016-04-02 (newest). 2016-05-16 16:13:37 -06:00
config.rpath
config.sub config.guess: Import version 2016-04-02 (newest). 2016-05-16 16:13:37 -06:00
configure configure.ac: Add ARC support to libgloss. 2016-05-16 14:37:43 -06:00
configure.ac configure.ac: Add ARC support to libgloss. 2016-05-16 14:37:43 -06:00
depcomp Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
install-sh Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
libtool-ldflags re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan)) 2014-04-17 14:23:28 +02:00
libtool.m4 * libtool.m4 (export_symbols_cmds) [AIX]: Add global TLS "L" symbols. 2015-11-26 08:20:59 -05:00
ltgcc.m4
ltmain.sh Ensure libgcc_s unwinder is always used on 64-bit Solaris 10+/x86 (PR target/59788) 2014-02-04 09:31:38 +00:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
mkdep
mkinstalldirs Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
move-if-change Update move-if-change from gnulib 2014-11-16 16:12:44 +00:00
symlink-tree
ylwrap Update from upstream Automake files. 2014-11-16 14:07:13 +00:00

README

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.