[ARM] Fix PR45094

Submitted by Yao Qi on Aug. 3, 2010, 1:28 p.m.

Details

Message ID 20100803132852.GA15793@qiyaows
State New
Headers show

Commit Message

Yao Qi Aug. 3, 2010, 1:28 p.m.
On Sun, Aug 01, 2010 at 08:38:18PM -0400, Daniel Jacobowitz wrote:
> On Sun, Aug 01, 2010 at 10:58:29PM +0800, Yao Qi wrote:
> > Oops...  Correct typo in new patch.
> 
> This suggests there should be an execute test.  When possible, those
> are better.

Revise test case to an 'execute test', rather than a 'compile test'.
Bootstrapped and regression tested on arm-unknown-linux-gnueabi.  No
regression.  OK to commit?

Comments

Ramana Radhakrishnan Aug. 3, 2010, 11:58 p.m.
On Tue, Aug 3, 2010 at 2:28 PM, Yao Qi <yao@codesourcery.com> wrote:
> On Sun, Aug 01, 2010 at 08:38:18PM -0400, Daniel Jacobowitz wrote:
>> On Sun, Aug 01, 2010 at 10:58:29PM +0800, Yao Qi wrote:
>> > Oops...  Correct typo in new patch.
>>
>> This suggests there should be an execute test.  When possible, those
>> are better.
>
> Revise test case to an 'execute test', rather than a 'compile test'.
> Bootstrapped and regression tested on arm-unknown-linux-gnueabi.  No
> regression.  OK to commit?

No - this test is still not ok. It is not necessary that all
arm-linux-gnueabi targets have Neon. Think about the Tegra2 where
there is no Neon unit where this test will fail. Thus if you really
need the neon options (out of curiosity why?) please add the following
to the test.

/* { dg-require-effective-target arm_neon_hw } */

before the dg-do run. IIRC there might be examples in other tests in
gcc.target/arm/neon*.c


cheers
Ramana






cheers
Ramana




>
> --
> Yao Qi
> CodeSourcery
> yao@codesourcery.com
> (650) 331-3385 x739
>

Patch hide | download patch | download mbox

gcc/
	PR target/45094
	* config/arm/arm.c (output_move_double): Fix typo generating 
	instructions ('ldr'->'str').

gcc/testsuite/

	PR target/45094
	* gcc.target/arm/pr45094.c: New test.

Index: gcc/testsuite/gcc.target/arm/pr45094.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr45094.c	(revision 0)
+++ gcc/testsuite/gcc.target/arm/pr45094.c	(revision 0)
@@ -0,0 +1,24 @@ 
+/* { dg-do run } */
+/* { dg-options "-O2 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp" } */
+
+#include <stdlib.h>
+
+long long buffer[32];
+
+void __attribute__((noinline)) f(long long *p, int n)
+{
+  while (--n >= 0) {
+   *p = 1;
+        p += 32;
+    }
+}
+
+int main(void)
+{
+  f(buffer, 1);
+  
+  if (!buffer[0])
+    abort();
+
+  return 0;
+}
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 162792)
+++ gcc/config/arm/arm.c	(working copy)
@@ -12570,13 +12570,13 @@ 
 	    {
 	      if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY)
 		{
-		  output_asm_insn ("ldr%?\t%0, [%1, %2]!", otherops);
-		  output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops);
+		  output_asm_insn ("str%?\t%0, [%1, %2]!", otherops);
+		  output_asm_insn ("str%?\t%H0, [%1, #4]", otherops);
 		}
 	      else
 		{
-		  output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops);
-		  output_asm_insn ("ldr%?\t%0, [%1], %2", otherops);
+		  output_asm_insn ("str%?\t%H0, [%1, #4]", otherops);
+		  output_asm_insn ("str%?\t%0, [%1], %2", otherops);
 		}
 	    }
 	  else if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY)