Patchwork [testsuite] Skip case ipa-sra-2.c for strict_align target.

login
register
mail settings
Submitter Terry Guo
Date Sept. 7, 2011, 7:47 a.m.
Message ID <002701cc6d32$5d6e64d0$184b2e70$@guo@arm.com>
Download mbox | patch
Permalink /patch/113716/
State New
Headers show

Comments

Terry Guo - Sept. 7, 2011, 7:47 a.m.
Hello,

The SRA optimization requires the reference to struct/union member must be
aligned to their natural boundary e.g. (int *) must be aligned to 4 byte
boundary. This is done in function tree_non_mode_aligned_mem_p. For target
like x86 that define "STRICT_ALIGNMENT" to 0, the function return false.
Afterward, the SRA is conducted. For target like ARM or MIPS that define
"STRICT_ALIGNMENT" to 1, the alignment status is checked by "align =
get_object_alignment (exp)". The function get_object_alignment rely on SSA
and tend to over-conservative. So for most cases, the SRA is stopped here.

This patch intends to skip this case for target that set STRICT_ALIGNMENT to
1 otherwise the case will fail due to the SRA isn't performed actually. OK
to commit to trunk?

BR,
Terry

2011-09-07  Terry Guo  <terry.guo@arm.com>

        * gcc.dg/ipa/ipa-sra-2.c: Only run on 
        targets that are non_strict_align.

Patch

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
index 3437a81..c6b4d63 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details"  } */
+/* { dg-require-effective-target non_strict_align } */
 
 struct bovid
 {