This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).
- From: Martin Liška <mliska at suse dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, Martin Jambor <mjambor at suse dot cz>
- Date: Mon, 27 Mar 2017 13:40:12 +0200
- Subject: Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).
- Authentication-results: sourceware.org; auth=none
- References: <5040cf25-9cfb-995c-2442-c4c705533733@suse.cz> <CAFiYyc1eSRJJUk+szY1T6DKs=ZphSc=ekMmb6ahYOvNy_3+6Bg@mail.gmail.com>
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