aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2015-09-01 10:32:24 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2015-09-01 10:32:24 +0000
commit6e17a23b53608872a0c7907c02827d1cf8f79940 (patch)
tree1e44c690fbbb37f38561dac95e9a12b01bdf9d73 /gcc
parent6853b04cdd6269c596bf4dd24b41eee2170caef3 (diff)
downloadgcc-6e17a23b53608872a0c7907c02827d1cf8f79940.zip
gcc-6e17a23b53608872a0c7907c02827d1cf8f79940.tar.gz
gcc-6e17a23b53608872a0c7907c02827d1cf8f79940.tar.bz2
[AArch64] Fix FAIL: gcc.target/aarch64/target_attr_crypto_ice_1.c (internal compiler error)
* config/aarch64/aarch64.c (aarch64_set_current_function): Re-layout any vector parameters have non-simd layout. * config/aarch64/aarch64-builtins.c (aarch64_relayout_simd_param): Delete. (aarch64_simd_expand_args): Delete call to the above. * gcc.target/aarch64/target_attr_crypto_ice_2.c: New test. From-SVN: r227363
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/aarch64/aarch64-builtins.c25
-rw-r--r--gcc/config/aarch64/aarch64.c17
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c20
5 files changed, 49 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2e7230b..401c0c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_set_current_function):
+ Re-layout any vector parameters have non-simd layout.
+ * config/aarch64/aarch64-builtins.c (aarch64_relayout_simd_param):
+ Delete.
+ (aarch64_simd_expand_args): Delete call to the above.
+
2015-08-31 Mike Frysinger <vapier@gentoo.org>
* doc/invoke.texi (asan-stack): Add space before option.
diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index 0f4f2b9..e3a90b5 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -886,30 +886,6 @@ typedef enum
SIMD_ARG_STOP
} builtin_simd_arg;
-/* Relayout the decl of a function arg. Keep the RTL component the same,
- as varasm.c ICEs. It doesn't like reinitializing the RTL
- on PARM decls. Something like this needs to be done when compiling a
- file without SIMD and then tagging a function with +simd and using SIMD
- intrinsics in there. The types will have been laid out assuming no SIMD,
- so we want to re-lay them out. */
-
-static void
-aarch64_relayout_simd_param (tree arg)
-{
- tree argdecl = arg;
- if (TREE_CODE (argdecl) == SSA_NAME)
- argdecl = SSA_NAME_VAR (argdecl);
-
- if (argdecl
- && (TREE_CODE (argdecl) == PARM_DECL
- || TREE_CODE (argdecl) == VAR_DECL))
- {
- rtx rtl = NULL_RTX;
- rtl = DECL_RTL_IF_SET (argdecl);
- relayout_decl (argdecl);
- SET_DECL_RTL (argdecl, rtl);
- }
-}
static rtx
aarch64_simd_expand_args (rtx target, int icode, int have_retval,
@@ -940,7 +916,6 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
{
tree arg = CALL_EXPR_ARG (exp, opc - have_retval);
enum machine_mode mode = insn_data[icode].operand[opc].mode;
- aarch64_relayout_simd_param (arg);
op[opc] = expand_normal (arg);
switch (thisarg)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ce6e116..bc612e4 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -8111,6 +8111,23 @@ aarch64_set_current_function (tree fndecl)
= save_target_globals_default_opts ();
}
}
+
+ if (!fndecl)
+ return;
+
+ /* If we turned on SIMD make sure that any vector parameters are re-laid out
+ so that they use proper vector modes. */
+ if (TARGET_SIMD)
+ {
+ tree parms = DECL_ARGUMENTS (fndecl);
+ for (; parms && parms != void_list_node; parms = TREE_CHAIN (parms))
+ {
+ if (TREE_CODE (parms) == PARM_DECL
+ && VECTOR_TYPE_P (TREE_TYPE (parms))
+ && DECL_MODE (parms) != TYPE_MODE (TREE_TYPE (parms)))
+ relayout_decl (parms);
+ }
+ }
}
/* Enum describing the various ways we can handle attributes.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b9d9f84..f14ff33 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/target_attr_crypto_ice_2.c: New test.
+
2015-09-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61753
diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c
new file mode 100644
index 0000000..d6e7b68
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=thunderx+nofp" } */
+
+/* Make sure that we don't ICE when dealing with vector parameters
+ in a simd-tagged function within a non-simd translation unit. */
+
+#pragma GCC push_options
+#pragma GCC target ("+nothing+simd")
+typedef unsigned int __uint32_t;
+typedef __uint32_t uint32_t ;
+typedef __Uint32x4_t uint32x4_t;
+#pragma GCC pop_options
+
+
+__attribute__ ((target ("cpu=cortex-a57")))
+uint32x4_t
+foo (uint32x4_t a, uint32_t b, uint32x4_t c)
+{
+ return c;
+}