aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2017-08-01 20:25:41 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2017-08-01 13:25:41 -0700
commita2e28a974709c9b2712ff28aac2afccb492436a6 (patch)
treea6e6d60eb0b29ce9c96d6c6a739bcce6907fef1c /gcc
parentd8afd032fad763a31efe2da716da657bde7c556b (diff)
downloadgcc-a2e28a974709c9b2712ff28aac2afccb492436a6.zip
gcc-a2e28a974709c9b2712ff28aac2afccb492436a6.tar.gz
gcc-a2e28a974709c9b2712ff28aac2afccb492436a6.tar.bz2
386: Disallow naked attribute with interrupt attribute
gcc/ PR target/81654 * config/i386/i386.c (ix86_set_func_type): Disallow naked attribute with interrupt attribute. gcc/testsuite/ PR target/81654 * gcc.target/i386/pr81654.c: New test. From-SVN: r250793
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81654.c8
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 43b2311..64298bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/81654
+ * config/i386/i386.c (ix86_set_func_type): Disallow naked
+ attribute with interrupt attribute.
+
2017-08-01 Andrew Pinski <apinski@cavium.com>
* tree-ssa-scopedtables.c (hashable_expr_equal_p): Check
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 494a18a..587dbe6 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -7523,6 +7523,10 @@ ix86_set_func_type (tree fndecl)
if (lookup_attribute ("interrupt",
TYPE_ATTRIBUTES (TREE_TYPE (fndecl))))
{
+ if (ix86_function_naked (fndecl))
+ error_at (DECL_SOURCE_LOCATION (fndecl),
+ "interrupt and naked attributes are not compatible");
+
int nargs = 0;
for (tree arg = DECL_ARGUMENTS (fndecl);
arg;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3ba6bb9..7a0a030 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/81654
+ * gcc.target/i386/pr81654.c: New test.
+
2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/79312
diff --git a/gcc/testsuite/gcc.target/i386/pr81654.c b/gcc/testsuite/gcc.target/i386/pr81654.c
new file mode 100644
index 0000000..2a1a4b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81654.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mgeneral-regs-only" } */
+
+__attribute__((interrupt, naked))
+void
+fn (void *frame) /* { dg-error "not compatible" } */
+{
+}