public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors
@ 2015-04-22  8:42 Bin Cheng
  2015-04-23  8:19 ` Kyrill Tkachov
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Cheng @ 2015-04-22  8:42 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Hi,
Case pr42172-1.c failed on pre-armv7 processors because GCC actually
generates better code without ldr instruction.  This patch just refines test
case by checking str instead of ldr, makes sure the case passes on all arm
processors.  In the end, we need to fix GCC combiner to generate optimal
code on armv7 processors too.  PR42172 is kept open for that purpose.

This is obvious change, is it OK for branches too?

gcc/testsuite/ChangeLog
2015-04-22  Bin Cheng  <bin.cheng@arm.com>

	* gcc.target/arm/pr42172-1.c: Check str instead of ldr.


[-- Attachment #2: pr42172-1-check-str.txt --]
[-- Type: text/plain, Size: 406 bytes --]

diff --git a/gcc/testsuite/gcc.target/arm/pr42172-1.c b/gcc/testsuite/gcc.target/arm/pr42172-1.c
index 207f600..a3de02f 100644
--- a/gcc/testsuite/gcc.target/arm/pr42172-1.c
+++ b/gcc/testsuite/gcc.target/arm/pr42172-1.c
@@ -16,4 +16,4 @@ void init_A (struct A *this)
   this->f4 = 0;
 }
 
-/* { dg-final { scan-assembler-times "ldr" 1 } } */
+/* { dg-final { scan-assembler-times "str" 1 } } */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors
  2015-04-22  8:42 [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors Bin Cheng
@ 2015-04-23  8:19 ` Kyrill Tkachov
  2015-04-23  8:53   ` Bin.Cheng
  0 siblings, 1 reply; 4+ messages in thread
From: Kyrill Tkachov @ 2015-04-23  8:19 UTC (permalink / raw)
  To: Bin Cheng, gcc-patches


On 22/04/15 09:42, Bin Cheng wrote:
> Hi,
> Case pr42172-1.c failed on pre-armv7 processors because GCC actually
> generates better code without ldr instruction.  This patch just refines test
> case by checking str instead of ldr, makes sure the case passes on all arm
> processors.  In the end, we need to fix GCC combiner to generate optimal
> code on armv7 processors too.  PR42172 is kept open for that purpose.
>
> This is obvious change, is it OK for branches too?

For the record, for -mcpu=arm7tdmi we now generate:
init_A:
         mov     r3, #8
         strb    r3, [r0]
         bx


Ok for trunk. Is this test failing on the branches too?

Kyrill

>
> gcc/testsuite/ChangeLog
> 2015-04-22  Bin Cheng  <bin.cheng@arm.com>
>
> 	* gcc.target/arm/pr42172-1.c: Check str instead of ldr.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors
  2015-04-23  8:19 ` Kyrill Tkachov
@ 2015-04-23  8:53   ` Bin.Cheng
  2015-04-23  9:04     ` Kyrill Tkachov
  0 siblings, 1 reply; 4+ messages in thread
From: Bin.Cheng @ 2015-04-23  8:53 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: Bin Cheng, gcc-patches

On Thu, Apr 23, 2015 at 4:19 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>
> On 22/04/15 09:42, Bin Cheng wrote:
>>
>> Hi,
>> Case pr42172-1.c failed on pre-armv7 processors because GCC actually
>> generates better code without ldr instruction.  This patch just refines
>> test
>> case by checking str instead of ldr, makes sure the case passes on all arm
>> processors.  In the end, we need to fix GCC combiner to generate optimal
>> code on armv7 processors too.  PR42172 is kept open for that purpose.
>>
>> This is obvious change, is it OK for branches too?
>
>
> For the record, for -mcpu=arm7tdmi we now generate:
> init_A:
>         mov     r3, #8
>         strb    r3, [r0]
>         bx
That's the point, it generates optimal code for pre-armv7 processors,
which is treated as failure now.

>
>
> Ok for trunk. Is this test failing on the branches too?
Well, at least for gcc-5-branch.

>
> Kyrill
>
>
>>
>> gcc/testsuite/ChangeLog
>> 2015-04-22  Bin Cheng  <bin.cheng@arm.com>
>>
>>         * gcc.target/arm/pr42172-1.c: Check str instead of ldr.
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors
  2015-04-23  8:53   ` Bin.Cheng
@ 2015-04-23  9:04     ` Kyrill Tkachov
  0 siblings, 0 replies; 4+ messages in thread
From: Kyrill Tkachov @ 2015-04-23  9:04 UTC (permalink / raw)
  To: Bin.Cheng; +Cc: Bin Cheng, gcc-patches


On 23/04/15 09:53, Bin.Cheng wrote:
> On Thu, Apr 23, 2015 at 4:19 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>> On 22/04/15 09:42, Bin Cheng wrote:
>>> Hi,
>>> Case pr42172-1.c failed on pre-armv7 processors because GCC actually
>>> generates better code without ldr instruction.  This patch just refines
>>> test
>>> case by checking str instead of ldr, makes sure the case passes on all arm
>>> processors.  In the end, we need to fix GCC combiner to generate optimal
>>> code on armv7 processors too.  PR42172 is kept open for that purpose.
>>>
>>> This is obvious change, is it OK for branches too?
>>
>> For the record, for -mcpu=arm7tdmi we now generate:
>> init_A:
>>          mov     r3, #8
>>          strb    r3, [r0]
>>          bx
> That's the point, it generates optimal code for pre-armv7 processors,
> which is treated as failure now.
>
>>
>> Ok for trunk. Is this test failing on the branches too?
> Well, at least for gcc-5-branch.

If the GCC 5 branch is now open for commits (I think it is?), then ok there too.

Kyrill

>
>> Kyrill
>>
>>
>>> gcc/testsuite/ChangeLog
>>> 2015-04-22  Bin Cheng  <bin.cheng@arm.com>
>>>
>>>          * gcc.target/arm/pr42172-1.c: Check str instead of ldr.
>>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-23  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-22  8:42 [PATCH ARM]Fix pr42172-1.c failure on pre armv7 processors Bin Cheng
2015-04-23  8:19 ` Kyrill Tkachov
2015-04-23  8:53   ` Bin.Cheng
2015-04-23  9:04     ` Kyrill Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).