From: jakub Date: Wed, 30 Jan 2019 07:51:24 +0000 (+0000) Subject: PR c++/89105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4ffc4c17b0824955f65b3611045c7237cd5100;p=thirdparty%2Fgcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268382 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b9c8e4976f3..2e6f49e92ff3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-01-30 Jakub Jelinek + + 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 * 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 2b5bd682639a..4e67abe87646 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 d60389f4c4f1..e9846c7710df 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-01-30 Jakub Jelinek + 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 000000000000..689e5ee5b6b1 --- /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 + 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" } +}