From 0e081bde913120cdf87ac288c814dfcc9733eacb Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Tue, 7 Apr 2015 14:06:38 +0000 Subject: [PATCH] ipa-comdats.c (ipa_comdats): Visit all thunks to set proper comdat group. gcc/ * ipa-comdats.c (ipa_comdats): Visit all thunks to set proper comdat group. gcc/testsuite/ * gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: New. * gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: New. From-SVN: r221896 --- gcc/ChangeLog | 5 ++++ gcc/ipa-comdats.c | 2 +- gcc/testsuite/ChangeLog | 5 ++++ .../i386/mpx/chkp-thunk-comdat-1.cc | 18 +++++++++++++ .../i386/mpx/chkp-thunk-comdat-2.cc | 26 +++++++++++++++++++ 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc create mode 100644 gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f65dd4d1e76..7b977dd8933 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-04-07 Ilya Enkovich + + * ipa-comdats.c (ipa_comdats): Visit all thunks + to set proper comdat group. + 2015-04-07 Kyrylo Tkachov PR target/65489 diff --git a/gcc/ipa-comdats.c b/gcc/ipa-comdats.c index f349f9f087e..e24359cff19 100644 --- a/gcc/ipa-comdats.c +++ b/gcc/ipa-comdats.c @@ -377,7 +377,7 @@ ipa_comdats (void) fprintf (dump_file, "To group: %s\n", IDENTIFIER_POINTER (group)); } if (is_a (symbol)) - dyn_cast (symbol)->call_for_symbol_and_aliases + dyn_cast (symbol)->call_for_symbol_thunks_and_aliases (set_comdat_group_1, *comdat_head_map.get (group), true); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7684dbc1b3a..a51b9c56abb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-04-07 Ilya Enkovich + + * gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: New. + * gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: New. + 2015-04-07 Bin Cheng * gcc.target/arm/pr65647.c: Add option "-mfloat-abi=soft". diff --git a/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc new file mode 100644 index 00000000000..26d3c48a621 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ + +namespace +{ + template + int __attribute__((noinline)) + f1 () + { + return dim; + } +} + +int +test () +{ + return f1<3> (); +} diff --git a/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc new file mode 100644 index 00000000000..2b1abe9b67d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ + +class c1 +{ +public: + virtual int test1 (const char *); +}; + +class c2 +{ +public: + int test2 (const char *); +}; + +int +c1::test1 (const char *) +{ + return 0; +} + +int +c2::test2 (const char *) +{ + return 0; +} -- 2.30.2