This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM][PATCH] Vectorizer generates unaligned access when -mno-unaligned-access is enabled
- From: Ramana Radhakrishnan <ramrad01 at arm dot com>
- To: Kugan <kugan dot vivekanandarajah at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Tue, 04 Feb 2014 15:54:31 +0000
- Subject: Re: [ARM][PATCH] Vectorizer generates unaligned access when -mno-unaligned-access is enabled
- Authentication-results: sourceware.org; auth=none
- References: <52EF2C1D dot 7050207 at linaro dot org>
On 02/03/14 05:41, Kugan wrote:
With the 2013-09-21 version of trunk, attached test case results in bus
error when simultaneously enabling both -mno-unaligned-access and
-ftree-vectorize.
The error is caused by unaligned vector load via two vldr instructions:
vldr d16, [r3, #-16]
vldr d17, [r3, #-8]
So, does this mean that we get unaligned vector loads when
munaligned-access is on, using vldr instructions ? This worries me
because we shouldn't be putting out vldr's. I was hoping to have dug a
bit further today but don't think I will make much more progress. Can
you dig a bit further to make sure that this is only code path that
triggers this ?
Cause for this error is, even when -mno-unaligned-access is enabled,
backend will inform vectorizer that it supports misaligned accesses
via TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT.
Attached patch fixes this. Is this OK for trunk?
How has it been tested ?
Ramana
Thanks,
Kugan
+2014-02-03 Yury Gribov <tetra2005@gmail.com>
+ Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ * config/arm/arm.c (arm_vector_alignment_reachable): Check
+ unaligned_access.
+ * config/arm/arm.c (arm_builtin_support_vector_misalignment): Likewise.
+
+2014-02-03 Yury Gribov <tetra2005@gmail.com>
+ Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ * gcc.target/arm/vect-noalign.c: New file.
+
--
Ramana Radhakrishnan
Principal Engineer
ARM Ltd.