From 0ff2bf464e5b159a2634f8f83363378e5d8f06ef Mon Sep 17 00:00:00 2001 From: Max Ostapenko Date: Wed, 1 Apr 2015 14:18:03 +0300 Subject: [PATCH] re PR target/65624 (ICE in aarch64-builtins.c when expanding 4-argument aarch64 intrinsic.) 2015-04-01 Max Ostapenko PR target/65624 gcc/ * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin): Increase args array size by one to avoid buffer overflow. gcc/testsuite/ * gcc.target/aarch64/pr65624.c: New test. From-SVN: r221807 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64-builtins.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/aarch64/pr65624.c | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr65624.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c39d764e01..11a79db10a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-01 Max Ostapenko + + PR target/65624 + * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin): Increase + args array size by one to avoid buffer overflow. + 2015-03-31 Jan Hubicka * lto-cgraph.c (lto_output_node, input_overwrite_node): Stream diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index a9b330591eb..8a9fff8720d 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -1025,7 +1025,7 @@ aarch64_simd_expand_builtin (int fcode, tree exp, rtx target) aarch64_simd_builtin_datum *d = &aarch64_simd_builtin_data[fcode - AARCH64_SIMD_PATTERN_START]; enum insn_code icode = d->code; - builtin_simd_arg args[SIMD_MAX_BUILTIN_ARGS]; + builtin_simd_arg args[SIMD_MAX_BUILTIN_ARGS + 1]; int num_args = insn_data[d->code].n_operands; int is_void = 0; int k; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0dd0421fce7..24fbed7c7bd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 Max Ostapenko + + PR target/65624 + * gcc.target/aarch64/pr65624.c: New test. + 2015-03-31 Jan Hubicka * gcc.dg/ipa/inlinehint-4.c: New testcase. diff --git a/gcc/testsuite/gcc.target/aarch64/pr65624.c b/gcc/testsuite/gcc.target/aarch64/pr65624.c new file mode 100644 index 00000000000..8eb3786a4b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr65624.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +#include + +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); +} -- 2.30.2