From: Martin Liska Date: Tue, 28 Mar 2017 09:01:57 +0000 (+0200) Subject: Fix calls.c for a _complex type (PR ipa/80104). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62f96a79f10e0c6772e5302c076b8c062e42b0d9;p=gcc.git Fix calls.c for a _complex type (PR ipa/80104). 2017-03-28 Martin Liska 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. 2017-03-28 Martin Liska PR ipa/80104 * gcc.dg/ipa/pr80104.c: New test. From-SVN: r246525 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4864d75bb66..27e7b8f0a75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-28 Martin Liska + + 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. + 2017-03-28 Claudiu Zissulescu Thomas Petazzoni 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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 93c9f9efed4..a896f753719 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-28 Martin Liska + + PR ipa/80104 + * gcc.dg/ipa/pr80104.c: New test. + 2017-03-28 Marek Polacek PR sanitizer/80067 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]; +}