Re: [PATCH] Add to same comdate group only if set (PR middle-end/90899)

2019-07-02 Thread Jeff Law
On 6/18/19 2:58 AM, Martin Liška wrote:
> Hi.
> 
> The patch is quite obvious, it copies the same what we do in
> another IPA passes.
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-06-18  Martin Liska  
> 
>   PR middle-end/90899
>   * multiple_target.c (create_dispatcher_calls): Add to comdat
>   group only if set for ifunc.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-06-18  Martin Liska  
> 
>   PR middle-end/90899
>   * gcc.target/i386/pr90899.c: New test.
OK
jeff


Re: [PATCH] Add to same comdate group only if set (PR middle-end/90899)

2019-06-26 Thread Martin Liška
PING^1

On 6/18/19 10:58 AM, Martin Liška wrote:
> Hi.
> 
> The patch is quite obvious, it copies the same what we do in
> another IPA passes.
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-06-18  Martin Liska  
> 
>   PR middle-end/90899
>   * multiple_target.c (create_dispatcher_calls): Add to comdat
>   group only if set for ifunc.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-06-18  Martin Liska  
> 
>   PR middle-end/90899
>   * gcc.target/i386/pr90899.c: New test.
> ---
>  gcc/multiple_target.c   | 3 ++-
>  gcc/testsuite/gcc.target/i386/pr90899.c | 6 ++
>  2 files changed, 8 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr90899.c
> 
> 



[PATCH] Add to same comdate group only if set (PR middle-end/90899)

2019-06-18 Thread Martin Liška
Hi.

The patch is quite obvious, it copies the same what we do in
another IPA passes.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

2019-06-18  Martin Liska  

PR middle-end/90899
* multiple_target.c (create_dispatcher_calls): Add to comdat
group only if set for ifunc.

gcc/testsuite/ChangeLog:

2019-06-18  Martin Liska  

PR middle-end/90899
* gcc.target/i386/pr90899.c: New test.
---
 gcc/multiple_target.c   | 3 ++-
 gcc/testsuite/gcc.target/i386/pr90899.c | 6 ++
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90899.c


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/gcc.target/i386/pr90899.c b/gcc/testsuite/gcc.target/i386/pr90899.c
new file mode 100644
index 000..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;