re PR target/46329 (ICE on ARM for __attribute__ ((vector_size (8 * sizeof(int))...
authorRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 21 Apr 2011 09:39:03 +0000 (09:39 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 21 Apr 2011 09:39:03 +0000 (09:39 +0000)
gcc/
PR target/46329
* config/arm/arm.c (arm_legitimate_constant_p_1): Return false
for all Neon struct constants.

gcc/testsuite/
2011-04-04  Richard Earnshaw  <rearnsha@arm.com>
    Richard Sandiford  <richard.sandiford@linaro.org>

PR target/46329
* gcc.target/arm/pr46329.c: New test.

From-SVN: r172815

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr46329.c [new file with mode: 0644]

index 95f931b75708ccc5b169fd7c937814d61e45c1f1..ec65ff12d955c97d5f56f7403139df1e392d1010 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-21  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       PR target/46329
+       * config/arm/arm.c (arm_legitimate_constant_p_1): Return false
+       for all Neon struct constants.
+
 2011-04-21  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * target.def (legitimate_constant_p): New hook.
index 97d2d6f47e58aa273dbce7f0669711615ef0503f..175352e372c2281df18c71e2a4faf69cc39b35b3 100644 (file)
@@ -6511,8 +6511,14 @@ arm_tls_referenced_p (rtx x)
    When generating pic allow anything.  */
 
 static bool
-arm_legitimate_constant_p_1 (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
+arm_legitimate_constant_p_1 (enum machine_mode mode, rtx x)
 {
+  /* At present, we have no support for Neon structure constants, so forbid
+     them here.  It might be possible to handle simple cases like 0 and -1
+     in future.  */
+  if (TARGET_NEON && VALID_NEON_STRUCT_MODE (mode))
+    return false;
+
   return flag_pic || !label_mentioned_p (x);
 }
 
index ae5daf2af530798a0b9d7cda5b49b70a732d3153..56cc38a04da18ecc62dc62459598d614408da78f 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-21  Richard Earnshaw  <rearnsha@arm.com>
+           Richard Sandiford  <richard.sandiford@linaro.org>
+
+       PR target/46329
+       * gcc.target/arm/pr46329.c: New test.
+
 2011-04-21  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/18918
diff --git a/gcc/testsuite/gcc.target/arm/pr46329.c b/gcc/testsuite/gcc.target/arm/pr46329.c
new file mode 100644 (file)
index 0000000..9dd939c
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_neon } */
+
+int __attribute__ ((vector_size (32))) x;
+void
+foo (void)
+{
+  x <<= x;
+}