This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).


Hello.

There's alternative approach suggested by Martin Jambor.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests and
s390x cross compiler does not ICE.

Martin
>From f9e40be62e525d29347339316073fae425b0d516 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 24 Mar 2017 15:47:34 +0100
Subject: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).

gcc/ChangeLog:

2017-03-23  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-23  Martin Liska  <mliska@suse.cz>

	* gcc.dg/ipa/pr80104.c: New test.
---
 gcc/cgraphunit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index c82a88a599c..8635e3bd0e9 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1806,6 +1806,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
-- 
2.12.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]