mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-14 11:50:01 +08:00
The documentation says For a named pattern, the condition may not depend on the data in the insn being matched, but only the target-machine-type flags. The i386 backend violates that by using flag_excess_precision and flag_unsafe_math_optimizations in the conditions too, which is bad when optimize attribute or pragmas are used. The problem is that the middle-end caches the enabled conditions for the optabs for a particular switchable target, but multiple functions can share the same TARGET_OPTION_NODE, but have different TREE_OPTIMIZATION_NODE with different flag_excess_precision or flag_unsafe_math_optimizations, so the enabled conditions then match only one of those. I think best would be to just have a single options node for both the generic and target options, then such problems wouldn't exist, but that would be very risky at this point and quite large change. So, instead the following patch just shadows flag_excess_precision and flag_unsafe_math_optimizations values for uses in the instruction conditions in TargetVariable and during set_cfun artificially creates new TARGET_OPTION_NODE if flag_excess_precision and/or flag_unsafe_math_optimizations change from what is recorded in their TARGET_OPTION_NODE. The target nodes are hashed, so worst case we can get 4 times as many target option nodes if one would for each unique target option try all the flag_excess_precision and flag_unsafe_math_optimizations values. 2020-12-08 Jakub Jelinek <jakub@redhat.com> PR target/94440 * config/i386/i386.opt (ix86_excess_precision, ix86_unsafe_math_optimizations): New TargetVariables. * config/i386/i386.h (X87_ENABLE_ARITH, X87_ENABLE_FLOAT): Use ix86_unsafe_math_optimizations instead of flag_unsafe_math_optimizations and ix86_excess_precision instead of flag_excess_precision. * config/i386/i386.c (ix86_excess_precision): Rename to ... (ix86_get_excess_precision): ... this. (TARGET_C_EXCESS_PRECISION): Define to ix86_get_excess_precision. * config/i386/i386-options.c (ix86_valid_target_attribute_tree, ix86_option_override_internal): Update ix86_unsafe_math_optimization from flag_unsafe_math_optimizations and ix86_excess_precision from flag_excess_precision when constructing target option nodes. (ix86_set_current_function): If flag_unsafe_math_optimizations or flag_excess_precision is different from the one recorded in TARGET_OPTION_NODE, create a new target option node for the current function and switch to that. |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
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 | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
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.