re PR target/69187 (ICE: Aborted when native compiling neon code with __builtin_neon_...
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Thu, 21 Jan 2016 09:52:46 +0000 (10:52 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 Jan 2016 09:52:46 +0000 (10:52 +0100)
PR target/69187
PR target/65624
* config/arm/arm-builtins.c (arm_expand_neon_builtin): Increase
args array size by one to avoid buffer overflow.

* gcc.target/arm/pr69187.c: New test.

From-SVN: r232668

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

index 2ea6938..a17a403 100644 (file)
@@ -1,3 +1,11 @@
+2016-01-21   Stefan Sørensen  <stefan.sorensen@spectralink.com>
+            Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/69187
+       PR target/65624
+       * config/arm/arm-builtins.c (arm_expand_neon_builtin): Increase
+       args array size by one to avoid buffer overflow.
+
 2016-01-21  Marcin Kościelnicki  <koriakin@0x04.net>
 
        * config/s390/s390.md (pool_section_start): Use switch_to_section
index db6b29d..90fb40f 100644 (file)
@@ -2246,7 +2246,7 @@ arm_expand_neon_builtin (int fcode, tree exp, rtx target)
   neon_builtin_datum *d =
                &neon_builtin_data[fcode - ARM_BUILTIN_NEON_PATTERN_START];
   enum insn_code icode = d->code;
-  builtin_arg args[SIMD_MAX_BUILTIN_ARGS];
+  builtin_arg args[SIMD_MAX_BUILTIN_ARGS + 1];
   int num_args = insn_data[d->code].n_operands;
   int is_void = 0;
   int k;
index a6bc40c..3ef65ab 100644 (file)
@@ -1,5 +1,9 @@
 2016-01-21  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/69187
+       PR target/65624
+       * gcc.target/arm/pr69187.c: New test.
+
        PR c++/69355
        * g++.dg/torture/pr69355.C: New test.
 
diff --git a/gcc/testsuite/gcc.target/arm/pr69187.c b/gcc/testsuite/gcc.target/arm/pr69187.c
new file mode 100644 (file)
index 0000000..9992a69
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR target/69187 */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon } */
+/* { dg-options "-O0" }  */
+/* { dg-add-options arm_neon }  */
+
+#include <arm_neon.h>
+
+int32x4_t
+foo (void)
+{
+  int32x4_t vector_int32x4;
+  int16x4_t vector3_int16x4;
+  int16x4_t vector4_int16x4;
+  static int32_t buffer_int32x4[32];
+
+  vector_int32x4 = vld1q_s32(buffer_int32x4);
+  return vqdmlsl_lane_s16(vector_int32x4, vector3_int16x4, vector4_int16x4, 0);
+}