diff mbox

[testsuite] Further reduce the alignment In gcc.dg/vect/pr65310.c

Message ID 1425979088-11914-1-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh March 10, 2015, 9:18 a.m. UTC
Hi,

The purpose of this test is to ensure the compiler does the right
thing when a pointer with larger assumed alignment is assigned to
a pointer with smaller assumed alignment. It checks for this with a
vector testcase expected to generate fixups for alignment.

For ARM targets we're perfectly happy with vectors aligned to
8-bytes, and so we don't need the fixup code, and the test fails.

This patch forces the alignment even smaller (4-byte), which causes the
test to start PASSing on ARM.

Tested on aarch64-none-elf, arm-none-eabi and x86_64-none-linux-gnu
to confirm no reressions elsewhere, and to confirm the patch fixes
the issue for ARM.

Does this fixup make sense, and if it does, is it OK for trunk?

Thanks,
James

---
2015-03-10  James Greenhalgh  <james.greenhalgh@arm.com>

	* gcc.dg/vect/pr65310.c (c): Reduce alignment to 4-bytes.

Comments

Richard Biener March 10, 2015, 9:22 a.m. UTC | #1
On Tue, 10 Mar 2015, James Greenhalgh wrote:

> 
> Hi,
> 
> The purpose of this test is to ensure the compiler does the right
> thing when a pointer with larger assumed alignment is assigned to
> a pointer with smaller assumed alignment. It checks for this with a
> vector testcase expected to generate fixups for alignment.
> 
> For ARM targets we're perfectly happy with vectors aligned to
> 8-bytes, and so we don't need the fixup code, and the test fails.
> 
> This patch forces the alignment even smaller (4-byte), which causes the
> test to start PASSing on ARM.
> 
> Tested on aarch64-none-elf, arm-none-eabi and x86_64-none-linux-gnu
> to confirm no reressions elsewhere, and to confirm the patch fixes
> the issue for ARM.
> 
> Does this fixup make sense, and if it does, is it OK for trunk?

Yeah - ok.

Thanks,
Richard.

> Thanks,
> James
> 
> ---
> 2015-03-10  James Greenhalgh  <james.greenhalgh@arm.com>
> 
> 	* gcc.dg/vect/pr65310.c (c): Reduce alignment to 4-bytes.
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/pr65310.c b/gcc/testsuite/gcc.dg/vect/pr65310.c
index 2fd51b4..91aa904 100644
--- a/gcc/testsuite/gcc.dg/vect/pr65310.c
+++ b/gcc/testsuite/gcc.dg/vect/pr65310.c
@@ -5,7 +5,7 @@  struct a
   int a[100];
 };
 typedef struct a b __attribute__ ((aligned (32)));
-typedef struct a c __attribute__ ((aligned (8)));
+typedef struct a c __attribute__ ((aligned (4)));
 
 int t(b *a)
 {