Hi,

Please find attached the patch that fixes abitest for ilp32.

"testfunc_ptr" is a 32bit pointer in ILP32 but is being loaded as 64bit.

Hence some of the func-ret testcases FAIL's for ILP32.

Please review the patch and let us know if its okay?

Regression tested on aarch64-elf.

Thanks,
Naveen

gcc/testsuite

2015-01-15  Andrew Pinski  <apin...@cavium.com>
                    Naveen H.S  <naveen.hurugalaw...@caviumnetworks.com>

        * gcc.target/aarch64/aapcs64/abitest.S (LABEL_TEST_FUNC_RETURN): Load
        testfunc_ptr as 32bit for ILP32 and 64bit for LP64.
--- gcc/testsuite/ChangeLog	2015-01-14 10:00:59.524914610 +0530
+++ gcc/testsuite/ChangeLog	2015-01-14 10:21:20.928932740 +0530
@@ -1,3 +1,9 @@
+2015-01-15  Andrew Pinski  <apin...@cavium.com>
+	    Naveen H.S  <naveen.hurugalaw...@caviumnetworks.com>
+
+	* gcc.target/aarch64/aapcs64/abitest.S (LABEL_TEST_FUNC_RETURN): Load
+	testfunc_ptr as 32bit for ILP32 and 64bit for LP64.
+
 2015-01-13  David Malcolm  <dmalc...@redhat.com>
 
 	* jit.dg/harness.h (set_up_logging): Move string concatenation
--- gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S	2015-01-14 09:37:46.368893934 +0530
+++ gcc/testsuite/gcc.target/aarch64/aapcs64/abitest.S	2015-01-14 10:13:08.456925431 +0530
@@ -2,6 +2,13 @@
 	.global myfunc
 	.type dumpregs,%function
 	.type myfunc,%function
+
+#ifdef __LP64__
+#define PTR_REG(n)      x##n
+#else
+#define PTR_REG(n)      w##n
+#endif
+
 dumpregs:
 myfunc:
       mov	x16, sp
@@ -48,7 +55,7 @@ myfunc:
 LABEL_TEST_FUNC_RETURN:
       adrp	x9, testfunc_ptr
       add	x9, x9, :lo12:testfunc_ptr
-      ldr	x9, [x9, #0]
+      ldr      PTR_REG(9), [x9, #0]
       blr	x9				// function return value test
       adrp	x9, saved_return_address
       add	x9, x9, :lo12:saved_return_address

Reply via email to