af7a5758bf
Since CET is applied to the whole program, it is correct to disallow -fcf-protection=full without -mcet. But compiler shouldn't crash. gcc/ PR target/85403 * config/i386/i386.c (get_builtin_code_for_version): Check error_mark_node. gcc/testsuite/ PR target/85403 * gcc.target/i386/pr85403.c: New test. --- gcc/config/i386/i386.c | 2 ++ gcc/testsuite/g++.dg/ext/mv1.C | 2 +- gcc/testsuite/g++.dg/ext/mv14.C | 2 +- gcc/testsuite/g++.dg/ext/mv15.C | 2 +- gcc/testsuite/g++.dg/ext/mv16.C | 2 +- gcc/testsuite/g++.dg/ext/mv17.C | 2 +- gcc/testsuite/g++.dg/ext/mv18.C | 2 +- gcc/testsuite/g++.dg/ext/mv19.C | 2 +- gcc/testsuite/g++.dg/ext/mv20.C | 2 +- gcc/testsuite/g++.dg/ext/mv21.C | 2 +- gcc/testsuite/g++.dg/ext/mv22.C | 2 +- gcc/testsuite/g++.dg/ext/mv23.C | 2 +- gcc/testsuite/g++.dg/ext/mv26.C | 1 + gcc/testsuite/g++.dg/ext/mv6.C | 2 +- gcc/testsuite/g++.dg/ext/mvc1.C | 1 + gcc/testsuite/gcc.target/i386/cet-notrack-icf-1.c | 2 +- gcc/testsuite/gcc.target/i386/cet-notrack-icf-3.c | 2 +- gcc/testsuite/gcc.target/i386/cet-property-2.c | 2 +- gcc/testsuite/gcc.target/i386/mvc1.c | 1 + gcc/testsuite/gcc.target/i386/mvc10.c | 1 + gcc/testsuite/gcc.target/i386/mvc11.c | 2 +- gcc/testsuite/gcc.target/i386/mvc6.c | 2 +- gcc/testsuite/gcc.target/i386/mvc7.c | 1 + gcc/testsuite/gcc.target/i386/mvc8.c | 2 +- gcc/testsuite/gcc.target/i386/mvc9.c | 2 +- gcc/testsuite/gcc.target/i386/pr81213.c | 1 + gcc/testsuite/gcc.target/i386/pr81214.c | 1 + gcc/testsuite/gcc.target/i386/pr85403.c | 10 ++++++++++ gcc/testsuite/gcc.target/i386/sse-26.c | 2 +- 29 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr85403.c diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6fa5b0add02..8a73fc0d316 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -32344,6 +32344,8 @@ get_builtin_code_for_version (tree decl, tree *predicate_list) &global_options_set); gcc_assert (target_node); + if (target_node == error_mark_node) + return 0; new_target = TREE_TARGET_OPTION (target_node); gcc_assert (new_target); diff --git a/gcc/testsuite/gcc.target/i386/pr85403.c b/gcc/testsuite/gcc.target/i386/pr85403.c new file mode 100644 index 00000000000..f4fb12dd4e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85403.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fcf-protection -mcet" } */ +/* { dg-require-ifunc "" } */ + +__attribute__((target_clones("avx","arch=slm","arch=core-avx2","default"))) +int +foo () +{ + return -2; +} /* { dg-error "requires Intel CET support" } */ From-SVN: r259400 |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libmpx | ||
libobjc | ||
liboffloadmic | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
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 | ||
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.