From d04295d24364b0138c354e249a4bb14e0a6ffb96 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 3 Jul 2019 10:31:35 +0200 Subject: [PATCH] Add to same comdate group only if set (PR middle-end/90899) 2019-07-03 Martin Liska PR middle-end/90899 * multiple_target.c (create_dispatcher_calls): Add to comdat group only if set for ifunc. 2019-07-03 Martin Liska PR middle-end/90899 * gcc.target/i386/pr90899.c: New test. From-SVN: r272992 --- gcc/ChangeLog | 6 ++++++ gcc/multiple_target.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr90899.c | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr90899.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3d1a07acb40..f2f69905f76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-03 Martin Liska + + PR middle-end/90899 + * multiple_target.c (create_dispatcher_calls): Add to comdat + group only if set for ifunc. + 2019-07-03 Martin Liska PR target/88056 diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c index fa194d416fe..7aea684a40a 100644 --- a/gcc/multiple_target.c +++ b/gcc/multiple_target.c @@ -158,7 +158,8 @@ create_dispatcher_calls (struct cgraph_node *node) { symtab_node *source = ref->referring; source->create_reference (inode, IPA_REF_ALIAS); - source->add_to_same_comdat_group (inode); + if (inode->get_comdat_group ()) + source->add_to_same_comdat_group (inode); } else gcc_unreachable (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc960bb7e1f..512e86cf2cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-03 Martin Liska + + PR middle-end/90899 + * gcc.target/i386/pr90899.c: New test. + 2019-07-03 Jakub Jelinek PR tree-optimization/91033 diff --git a/gcc/testsuite/gcc.target/i386/pr90899.c b/gcc/testsuite/gcc.target/i386/pr90899.c new file mode 100644 index 00000000000..e0e2d5ac6bb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr90899.c @@ -0,0 +1,6 @@ +/* PR middle-end/90899 */ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ + +__attribute__ ((target_clones ("default", "arch=slm"))) static int f () { return 0; } +__attribute__ ((alias ("f"))) __typeof (f) g; -- 2.30.2