Hi,

  The below patch adds the AVR target to the list of targets that don't
  have natural_alignment_32. It also skips ipa/propalign-*.c
  tests (which expect 4 byte alignment), if both
  natural_alignment_32 and natural_alignment_64 are false.

  Is this the right way to fix this? Ok to commit?

Regards
Senthil

gcc/testsuite/ChangeLog:

2016-08-11  Senthil Kumar Selvaraj  <senthil_kumar.selva...@atmel.com>

        * gcc.dg/ipa/propalign-1.c: Skip for targets with !natural_alignment_32
        and !natural_alignment_64.
        * gcc.dg/ipa/propalign-2.c: Likewise.
        * gcc.dg/ipa/propalign-3.c: Likewise.
        * gcc.dg/ipa/propalign-4.c: Likewise.
        * gcc.dg/ipa/propalign-5.c: Likewise.
        * lib/target-supports.exp
        (check_effective_target_natural_alignment_32): Add avr-*-*.

Index: gcc/testsuite/gcc.dg/ipa/propalign-1.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propalign-1.c      (revision 239318)
+++ gcc/testsuite/gcc.dg/ipa/propalign-1.c      (working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp -fdump-tree-optimized" 
} */
+/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { 
! natural_alignment_64 } } } */
 
 #include <stdint.h>
 
Index: gcc/testsuite/gcc.dg/ipa/propalign-2.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propalign-2.c      (revision 239318)
+++ gcc/testsuite/gcc.dg/ipa/propalign-2.c      (working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp -fdump-tree-optimized" 
} */
+/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { 
! natural_alignment_64 } } } */
 
 #include <stdint.h>
 
Index: gcc/testsuite/gcc.dg/ipa/propalign-3.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propalign-3.c      (revision 239318)
+++ gcc/testsuite/gcc.dg/ipa/propalign-3.c      (working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fno-ipa-cp-alignment -fno-early-inlining -fdump-ipa-cp 
-fdump-tree-optimized" } */
+/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { 
! natural_alignment_64 } } } */
 
 #include <stdint.h>
 
Index: gcc/testsuite/gcc.dg/ipa/propalign-4.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propalign-4.c      (revision 239318)
+++ gcc/testsuite/gcc.dg/ipa/propalign-4.c      (working copy)
@@ -1,5 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-ipa-cp"  } */
+/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { 
! natural_alignment_64 } } } */
+
 int n;
 
 static void
Index: gcc/testsuite/gcc.dg/ipa/propalign-5.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/propalign-5.c      (revision 239318)
+++ gcc/testsuite/gcc.dg/ipa/propalign-5.c      (working copy)
@@ -1,5 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-ipa-cp"  } */
+/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { 
! natural_alignment_64 } } } */
+
 int n;
 
 static void
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp       (revision 239318)
+++ gcc/testsuite/lib/target-supports.exp       (working copy)
@@ -5221,7 +5221,8 @@
     } else {
         # FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER.
         set et_natural_alignment_32_saved 1
-        if { ([istarget *-*-darwin*] && [is-effective-target lp64]) } {
+        if { ([istarget *-*-darwin*] && [is-effective-target lp64])
+             || [istarget avr-*-*] } {
             set et_natural_alignment_32_saved 0
         }
     }

Reply via email to