diff mbox

Backport to GCC6

Message ID f500ae3f-8182-ef57-19f9-826b2f9f7123@suse.cz
State New
Headers show

Commit Message

Martin Liška April 25, 2017, 11:44 a.m. UTC
Hello.

There's a series of revisions I would like to install to GCC 6 branch.
When I did the same couple weeks ago, Richi told me to install regression
without asking for a permission. However the series also contains various
fixed for PRs that are present probably from the time a functionality
was added. Thus I'm sending the whole series to ML.

Thanks,
Martin
diff mbox

Patch

From 9a12839d57f2246fa274463d5af99b1b9ee96559 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 28 Mar 2017 09:01:57 +0000
Subject: [PATCH 01/13] Backport r246525

gcc/ChangeLog:

2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* cgraphunit.c (cgraph_node::expand_thunk): Mark argument of a
	thunk call as DECL_GIMPLE_REG_P when vector or complex type.

gcc/testsuite/ChangeLog:

2017-03-28  Martin Liska  <mliska@suse.cz>

	PR ipa/80104
	* gcc.dg/ipa/pr80104.c: New test.
---
 gcc/cgraphunit.c                   |  4 ++++
 gcc/testsuite/gcc.dg/ipa/pr80104.c | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/ipa/pr80104.c

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 71e88be753a..2fe207b7f4e 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1764,6 +1764,10 @@  cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
 	for (; i < nargs; i++, arg = DECL_CHAIN (arg))
 	  {
 	    tree tmp = arg;
+	    if (VECTOR_TYPE_P (TREE_TYPE (arg))
+		|| TREE_CODE (TREE_TYPE (arg)) == COMPLEX_TYPE)
+	      DECL_GIMPLE_REG_P (arg) = 1;
+
 	    if (!is_gimple_val (arg))
 	      {
 		tmp = create_tmp_reg (TYPE_MAIN_VARIANT
diff --git a/gcc/testsuite/gcc.dg/ipa/pr80104.c b/gcc/testsuite/gcc.dg/ipa/pr80104.c
new file mode 100644
index 00000000000..7e75c9907e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr80104.c
@@ -0,0 +1,15 @@ 
+/* PR ipa/80104 */
+/* { dg-do compile } */
+/* { dg-options "-fipa-icf" } */
+
+float
+a (_Complex float b)
+{
+  return *&b;
+}
+
+float
+c (_Complex float b)
+{
+  return (&b)[0];
+}
-- 
2.12.2