aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMatthew Malcomson <matthew.malcomson@arm.com>2020-04-09 16:11:09 +0100
committerMatthew Malcomson <matthew.malcomson@arm.com>2020-04-09 16:11:09 +0100
commita4d2774c9c1e213cb129c8b81a591297669838c8 (patch)
tree2fdaed046a07816384088601330b27dc160102e1 /gcc
parentbbb0de4a4ac9d6b6b6ca6be4755913bf4379d51a (diff)
downloadgcc-a4d2774c9c1e213cb129c8b81a591297669838c8.zip
gcc-a4d2774c9c1e213cb129c8b81a591297669838c8.tar.gz
gcc-a4d2774c9c1e213cb129c8b81a591297669838c8.tar.bz2
[Arm] Allow the use of arm_cde.h for C++
arm_cde.h includes the arm_mve_types.h header, which declares some C++ overloaded functions. There is a superfluous `extern "C"` statement in arm_cde.h, which encompasses these functions. This means that if compiling for C++, the overloaded functions are declared, but are declared without name mangling. Hence all the function names are the same and we have many conflicting declarations. Testing Done: Regression tested for arm-none-eabi. gcc/ChangeLog: 2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com> * config/arm/arm_cde.h: Remove `extern "C"` when compiling for C++. gcc/testsuite/ChangeLog: 2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com> * g++.target/arm/cde_mve.C: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm_cde.h8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.target/arm/cde_mve.C10
4 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 368dfd6..d081003 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * config/arm/arm_cde.h: Remove `extern "C"` when compiling for
+ C++.
+
2020-04-09 Martin Jambor <mjambor@suse.cz>
Richard Biener <rguenther@suse.de>
diff --git a/gcc/config/arm/arm_cde.h b/gcc/config/arm/arm_cde.h
index d8ddda6..0ba3ee0 100644
--- a/gcc/config/arm/arm_cde.h
+++ b/gcc/config/arm/arm_cde.h
@@ -27,10 +27,6 @@
#ifndef _GCC_ARM_CDE_H
#define _GCC_ARM_CDE_H 1
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#if defined (__ARM_FEATURE_CDE)
@@ -177,8 +173,4 @@ extern "C" {
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5e56c38..d79c4db 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * g++.target/arm/cde_mve.C: New test.
+
2020-04-09 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/arm/cmse/cmse-15.c: Use check-function-bodies.
diff --git a/gcc/testsuite/g++.target/arm/cde_mve.C b/gcc/testsuite/g++.target/arm/cde_mve.C
new file mode 100644
index 0000000..897cbd2
--- /dev/null
+++ b/gcc/testsuite/g++.target/arm/cde_mve.C
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_main_cde_mve_fp_ok } */
+/* { dg-add-options arm_v8_1m_main_cde_mve_fp } */
+
+/* Ensure this compiles. */
+#include "arm_cde.h"
+int foo ()
+{
+ return 1;
+}