aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-30 08:51:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-30 08:51:24 +0100
commit787e2debb8cb88138626ad7802c485f8b2c0694b (patch)
treeb31c5d55af689c6f7d5af3a7e651aa2e2f34edef
parentfe509359cf5ff58edd84bb1f28323af6dc4dd4b4 (diff)
downloadgcc-787e2debb8cb88138626ad7802c485f8b2c0694b.zip
gcc-787e2debb8cb88138626ad7802c485f8b2c0694b.tar.gz
gcc-787e2debb8cb88138626ad7802c485f8b2c0694b.tar.bz2
re PR c++/89105 (-Wabi warns for functions with internal linkage)
PR c++/89105 * config/i386/i386.c (ix86_warn_parameter_passing_abi): Don't warn for arguments to functions that are TU-local and shouldn't be referenced by assembly. * g++.target/i386/pr89105.C: New test. From-SVN: r268382
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.target/i386/pr89105.C16
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1b9c8e4..2e6f49e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/89105
+ * config/i386/i386.c (ix86_warn_parameter_passing_abi): Don't warn
+ for arguments to functions that are TU-local and shouldn't be
+ referenced by assembly.
+
2019-01-30 Ulrich Drepper <drepper@redhat.com>
* dumpfile.c (opt_info_switch_p_1): Ignore '-' if it appears
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2b5bd68..4e67abe 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29562,6 +29562,10 @@ ix86_warn_parameter_passing_abi (cumulative_args_t cum_v, tree type)
if (!TYPE_EMPTY_P (type))
return;
+ /* Don't warn if the function isn't visible outside of the TU. */
+ if (cum->decl && !TREE_PUBLIC (cum->decl))
+ return;
+
const_tree ctx = get_ultimate_context (cum->decl);
if (ctx != NULL_TREE
&& !TRANSLATION_UNIT_WARN_EMPTY_P (ctx))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d60389f..e9846c7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2019-01-30 Jakub Jelinek <jakub@redhat.com>
+ PR c++/89105
+ * g++.target/i386/pr89105.C: New test.
+
PR c/89061
* gcc.dg/pr89061.c: New test.
diff --git a/gcc/testsuite/g++.target/i386/pr89105.C b/gcc/testsuite/g++.target/i386/pr89105.C
new file mode 100644
index 0000000..689e5ee
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr89105.C
@@ -0,0 +1,16 @@
+// PR c++/89105
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=12 -Wabi=11" }
+
+namespace {
+ template<typename F>
+ void run(F f, int i) // { dg-bogus "parameter passing ABI changes in -fabi-version=12" }
+ {
+ f(i);
+ }
+}
+
+void f()
+{
+ run([](int) { }, 1); // { dg-bogus "parameter passing ABI changes in -fabi-version=12" }
+}