diff mbox

[testsuite] Skip tests that expect 4 byte alignment for avr

Message ID 8737mblpns.fsf@atmel.com
State New
Headers show

Commit Message

Senthil Kumar Selvaraj Aug. 11, 2016, 7:40 a.m. UTC
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.selvaraj@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-*-*.

Comments

Jeff Law Aug. 16, 2016, 4:45 p.m. UTC | #1
On 08/11/2016 01:40 AM, Senthil Kumar Selvaraj wrote:
> 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.selvaraj@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-*-*.
Do you need to add an avr case to 
check_effective_target_natural_alignment_64 as well?

Have you tested this on anything other than avr?

jeff
Senthil Kumar Selvaraj Aug. 17, 2016, 5:55 a.m. UTC | #2
Jeff Law writes:

> On 08/11/2016 01:40 AM, Senthil Kumar Selvaraj wrote:
>> 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.selvaraj@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-*-*.
> Do you need to add an avr case to 
> check_effective_target_natural_alignment_64 as well?

The 64 bit version is written to return true only for lp64 and spu-*-*,
so I didn't have to do anything there.
>
> Have you tested this on anything other than avr?
>

Yes, x86_64-pc-linux passes these tests, like it did before my patch.

Regards
Senthil
Jeff Law Aug. 18, 2016, 8:01 p.m. UTC | #3
On 08/16/2016 11:55 PM, Senthil Kumar Selvaraj wrote:
>
> Jeff Law writes:
>
>> On 08/11/2016 01:40 AM, Senthil Kumar Selvaraj wrote:
>>> 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.selvaraj@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-*-*.
>> Do you need to add an avr case to
>> check_effective_target_natural_alignment_64 as well?
>
> The 64 bit version is written to return true only for lp64 and spu-*-*,
> so I didn't have to do anything there.
>>
>> Have you tested this on anything other than avr?
>>
>
> Yes, x86_64-pc-linux passes these tests, like it did before my patch.
OK for the trunk.  Please install.

Thanks,
jeff
Mike Stump Aug. 20, 2016, 2:07 a.m. UTC | #4
On Aug 11, 2016, at 12:40 AM, Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> wrote:
> 
>  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?

LGTM.  Ok.

If anyone else has a reason why it would be bad, don't let me discourage you from speaking up.

> +/* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { ! natural_alignment_64 } } } */
diff mbox

Patch

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
         }
     }