GCC modified for the FreeChainXenon project
Find a file
Joseph Myers 5b8d936768 Prevent all uses of DFP when unsupported (PR c/91985).
Code that directly uses _Decimal* types on architectures not
supporting DFP is properly diagnosed ("error: decimal floating-point
not supported for this target"), via a call to
targetm.decimal_float_supported_p, if the _Decimal32, _Decimal64 or
_Decimal128 keywords are used to access it.  Use via mode attributes
is also diagnosed ("unable to emulate 'SD'"); so is use of the
FLOAT_CONST_DECIMAL64 pragma.  However, it is possible to access those
types via typeof applied to constants or built-in functions without
such an error.  I expect that there are ways to get an ICE from this;
certainly it uses a completely undefined ABI.

This patch arranges for the types not to exist in the compiler at all
when DFP is not supported.  As is done with unsupported _FloatN /
_FloatNx types, the global tree nodes are left as NULL_TREE, and the
built-in function machinery is made to use error_mark_node for them in
that case in builtin-types.def, so that the built-in functions are
unavailable.  Code handling constants is adjusted to give an error,
and other code that might not work with the global tree nodes being
NULL_TREE is also updated.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.  Also tested
with no regressions for cross to aarch64-linux-gnu, as a configuration
without DFP support.

	PR c/91985
gcc:
	* builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128)
	(BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR): Define to
	error_mark_node if corresponding global tree node is NULL.
	* tree.c (build_common_tree_nodes): Do not initialize
	dfloat32_type_node, dfloat64_type_node or dfloat128_type_node if
	decimal floating-point not supported.

gcc/c:
	* c-decl.c (finish_declspecs): Use int instead of decimal
	floating-point types if decimal floating-point not supported.

gcc/c-family:
	* c-common.c (c_common_type_for_mode): Handle decimal
	floating-point types being NULL_TREE.
	* c-format.c (get_format_for_type_1): Handle specified types being
	NULL_TREE.
	* c-lex.c (interpret_float): Give an error for decimal
	floating-point constants when decimal floating-point not
	supported.

gcc/lto:
	* lto-lang.c (lto_type_for_mode): Handle decimal floating-point
	types being NULL_TREE.

gcc/testsuite:
	* gcc.dg/c2x-no-dfp-1.c, gcc.dg/gnu2x-builtins-no-dfp-1.c: New
	tests.
	* gcc.dg/fltconst-pedantic-dfp.c: Expect errors when decimal
	floating-point not supported.

From-SVN: r278684
2019-11-25 13:45:42 +00:00
config [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
contrib download_prerequisites: Use http instead of ftp for downloading. 2019-11-13 19:48:52 +02:00
fixincludes [Darwin, fixincludes] Fix PR83531 2019-08-18 18:54:13 +00:00
gcc Prevent all uses of DFP when unsupported (PR c/91985). 2019-11-25 13:45:42 +00:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
include [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
INSTALL
intl iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
libada libada: Respect `--enable-version-specific-runtime-libs' 2019-10-01 19:14:11 +00:00
libatomic Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libbacktrace Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libcc1 Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libcpp Support UTF-8 character constants for C2x. 2019-11-14 20:18:33 +00:00
libdecnumber Update copyright years. 2019-01-01 13:31:55 +01:00
libffi Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libgcc fix ChangeLog to reference the PR 2019-11-18 12:46:56 +00:00
libgfortran re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file) 2019-11-24 22:14:59 +00:00
libgo re PR go/92605 (r278509 causes/reveals issue in building go library) 2019-11-21 01:06:47 +00:00
libgomp Fix failures on Solaris with -fno-common default 2019-11-21 16:14:21 +00:00
libhsail-rt Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libiberty [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
libitm Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libobjc Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
liboffloadmic Regenerate `liboffloadmic/plugin/configure' for r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC... 2019-10-01 19:57:44 +00:00
libphobos Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libquadmath Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libsanitizer Update comment in libsanitizer/*/libtool-version files. 2019-11-20 14:52:05 +00:00
libssp Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libstdc++-v3 libstdc++: Improve _GLIBCXX_DEBUG __valid_range check 2019-11-24 17:09:44 +00:00
libvtv Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
lto-plugin Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
maintainer-scripts Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
zlib Regenerate configure' scripts for uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
.dir-locals.el
.gitattributes * .gitattributes: Also check ChangeLog whitespace. 2019-10-21 23:12:04 -04:00
.gitignore Add .clangd and compile_commands.json to .gitignore. 2019-08-28 19:33:28 +00:00
ABOUT-NLS
ar-lib
ChangeLog Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
config.rpath
config.sub Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
configure Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
configure.ac Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS Remove my name from AArch64 port maintainers 2019-11-20 09:29:13 +00:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06: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.