Go to file
Richard Sandiford 4cfe7a6c35 Short-cut generation of simple built-in functions
This patch short-circuits the builtins.c expansion code for a particular
gimple call if:

- the function has an associated internal function
- the target implements that internal function
- the call has no side effects

This allows a later patch to remove the builtins.c code, once calls with
side effects have been handled.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.h (called_as_built_in): Declare.
	* builtins.c (called_as_built_in): Make external.
	* internal-fn.h (expand_internal_call): Define a variant that
	specifies the internal function explicitly.
	* internal-fn.c (expand_load_lanes_optab_fn)
	(expand_store_lanes_optab_fn, expand_ANNOTATE, expand_GOMP_SIMD_LANE)
	(expand_GOMP_SIMD_VF, expand_GOMP_SIMD_LAST_LANE)
	(expand_GOMP_SIMD_ORDERED_START, expand_GOMP_SIMD_ORDERED_END)
	(expand_UBSAN_NULL, expand_UBSAN_BOUNDS, expand_UBSAN_VPTR)
	(expand_UBSAN_OBJECT_SIZE, expand_ASAN_CHECK, expand_TSAN_FUNC_EXIT)
	(expand_UBSAN_CHECK_ADD, expand_UBSAN_CHECK_SUB)
	(expand_UBSAN_CHECK_MUL, expand_ADD_OVERFLOW, expand_SUB_OVERFLOW)
	(expand_MUL_OVERFLOW, expand_LOOP_VECTORIZED)
	(expand_mask_load_optab_fn, expand_mask_store_optab_fn)
	(expand_ABNORMAL_DISPATCHER, expand_BUILTIN_EXPECT, expand_VA_ARG)
	(expand_UNIQUE, expand_GOACC_DIM_SIZE, expand_GOACC_DIM_POS)
	(expand_GOACC_LOOP, expand_GOACC_REDUCTION, expand_direct_optab_fn)
	(expand_unary_optab_fn, expand_binary_optab_fn): Add an internal_fn
	argument.
	(internal_fn_expanders): Update prototype.
	(expand_internal_call): Define a variant that specifies the
	internal function explicitly. Use it to implement the previous
	interface.
	* cfgexpand.c (expand_call_stmt): Try to expand calls to built-in
	functions as calls to internal functions.

From-SVN: r230487
2015-11-17 18:51:20 +00:00
boehm-gc
config
contrib count-headers: Initial file. 2015-11-11 14:28:46 +00:00
fixincludes
gcc Short-cut generation of simple built-in functions 2015-11-17 18:51:20 +00:00
gnattools
gotools
include c-pragma.c (oacc_pragmas): Add entry for declare directive. 2015-11-12 22:20:41 +00:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcilkrts re PR target/66326 (Floating point exception with -mfpmath=387 and -fcilkplus.) 2015-11-09 10:12:34 +00:00
libcpp Source range tracking in libcpp and C FE, with bit-packing optimization 2015-11-13 16:29:59 +00:00
libdecnumber
libffi
libgcc on_exit.c: New file. 2015-11-15 18:41:44 -05:00
libgfortran
libgo libgo: use Solaris sendfile lib, fix Solaris _in6_addr_t fields 2015-11-10 21:38:30 +00:00
libgomp priority_queue.c: New file. 2015-11-17 09:29:34 -08:00
libiberty * Makefile.in (etags tags TAGS): Use && instead of ;. 2015-11-12 19:18:54 +00:00
libitm Support sized delete. 2015-11-09 17:30:24 +00:00
libjava
libmpx
libobjc
liboffloadmic omp-low.c (lower_omp_ordered): Add argument to GOMP_SMD_ORDERED_* internal calls - 0 if... 2015-11-14 19:42:13 +01:00
libquadmath
libsanitizer Update libsanitizer obstack interceptors 2015-11-09 14:53:25 +10:30
libssp
libstdc++-v3 re PR libstdc++/67440 (pretty-printing of a const set<foo> fails) 2015-11-16 21:32:26 +00:00
libvtv Correct libvtv obstack use 2015-11-09 14:49:43 +10:30
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitignore Local Vim config with GNU formatting. 2014-12-09 13:45:47 +00:00
ABOUT-NLS
ChangeLog configure.ac: Enable libmpx by default. 2015-11-13 06:48:20 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
config-ml.in
config.guess
config.rpath
config.sub
configure configure.ac: Enable libmpx by default. 2015-11-13 06:48:20 +00:00
configure.ac configure.ac: Enable libmpx by default. 2015-11-13 06:48:20 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change Update move-if-change from gnulib 2014-11-16 16:12:44 +00:00
README
symlink-tree
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.