diff mbox

[ARM] Updating testcase unsigned-extend-2.c

Message ID 57694C46.60802@arm.com
State New
Headers show

Commit Message

Andre Vieira (lists) June 21, 2016, 2:16 p.m. UTC
Hello,

After some changes to GCC this test no longer tests the desired code
generation behavior. The generated assembly is better than it used to
be, but it has become too smart. I add an extra parameter to make sure
GCC can't optimize away the loop.

Tested for arm-none-eabi-gcc with a Cortex-M3 target.

Is this OK?

Cheers,
Andre

gcc/ChangeLog
2016-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

        * gcc.target/arm/unsigned-extend-2.c: Update testcase.

Comments

Andre Vieira (lists) Dec. 12, 2016, 2:20 p.m. UTC | #1
On 21/06/16 15:16, Andre Vieira (lists) wrote:
> Hello,
> 
> After some changes to GCC this test no longer tests the desired code
> generation behavior. The generated assembly is better than it used to
> be, but it has become too smart. I add an extra parameter to make sure
> GCC can't optimize away the loop.
> 
> Tested for arm-none-eabi-gcc with a Cortex-M3 target.
> 
> Is this OK?
> 
> Cheers,
> Andre
> 
> gcc/ChangeLog
> 2016-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>
> 
>         * gcc.target/arm/unsigned-extend-2.c: Update testcase.
> 

Ping.
Andre Vieira (lists) Dec. 21, 2016, 12:05 p.m. UTC | #2
On 12/12/16 14:20, Andre Vieira (lists) wrote:
> On 21/06/16 15:16, Andre Vieira (lists) wrote:
>> Hello,
>>
>> After some changes to GCC this test no longer tests the desired code
>> generation behavior. The generated assembly is better than it used to
>> be, but it has become too smart. I add an extra parameter to make sure
>> GCC can't optimize away the loop.
>>
>> Tested for arm-none-eabi-gcc with a Cortex-M3 target.
>>
>> Is this OK?
>>
>> Cheers,
>> Andre
>>
>> gcc/ChangeLog
>> 2016-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>         * gcc.target/arm/unsigned-extend-2.c: Update testcase.
>>
> 
> Ping.
> 
Ping.
Kyrill Tkachov Dec. 21, 2016, 12:08 p.m. UTC | #3
Hi Andre,

On 21/06/16 15:16, Andre Vieira (lists) wrote:
> Hello,
>
> After some changes to GCC this test no longer tests the desired code
> generation behavior. The generated assembly is better than it used to
> be, but it has become too smart. I add an extra parameter to make sure
> GCC can't optimize away the loop.
>
> Tested for arm-none-eabi-gcc with a Cortex-M3 target.
>
> Is this OK?

Ok if this passes on an A-profile target as well (-march=armv7-a or some such).
Sorry for missing this.
Thanks,
Kyrill

> Cheers,
> Andre
>
> gcc/ChangeLog
> 2016-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>
>          * gcc.target/arm/unsigned-extend-2.c: Update testcase.
diff mbox

Patch

From 12da0a48045b37efb2e459116ec81cc7117a0981 Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Mon, 20 Jun 2016 14:27:06 +0100
Subject: [PATCH] fix testcase

---
 gcc/testsuite/gcc.target/arm/unsigned-extend-2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
index b610b73617dc6e6a5428c966380516007a02acba..013240749ecaabf0d2e8ad802d27c7edc69d8828 100644
--- a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
+++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
@@ -2,13 +2,13 @@ 
 /* { dg-require-effective-target arm_thumb2_ok } */
 /* { dg-options "-O" } */
 
-unsigned short foo (unsigned short x)
+unsigned short foo (unsigned short x, unsigned short c)
 {
   unsigned char i = 0;
   for (i = 0; i < 8; i++)
     {
       x >>= 1;
-      x &= 0x7fff;
+      x &= c;
     }
   return x;
 }
-- 
1.9.1