public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Add missing CFI register information [BZ #23614]
@ 2018-09-06 21:43 Tulio Magno Quites Machado Filho
  2018-09-28 19:01 ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-09-06 21:43 UTC (permalink / raw)
  To: libc-alpha

Add CFI information about the offset of registers stored in the stack
frame.

2018-09-06  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	[BZ #23614]
	* sysdeps/powerpc/powerpc64/addmul_1.S (FUNC): Add CFI offset for
	registers saved in the stack frame.
	* sysdeps/powerpc/powerpc64/lshift.S (__mpn_lshift): Likewise.
	* sysdeps/powerpc/powerpc64/mul_1.S (__mpn_mul_1): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S (__brk): Likewise.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 sysdeps/powerpc/powerpc64/addmul_1.S            | 31 +++++++++++++++++--------
 sysdeps/powerpc/powerpc64/lshift.S              | 12 ++++++----
 sysdeps/powerpc/powerpc64/mul_1.S               | 13 +++++++----
 sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S |  1 +
 4 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/sysdeps/powerpc/powerpc64/addmul_1.S b/sysdeps/powerpc/powerpc64/addmul_1.S
index 48e3b1b290..e450d6a52c 100644
--- a/sysdeps/powerpc/powerpc64/addmul_1.S
+++ b/sysdeps/powerpc/powerpc64/addmul_1.S
@@ -34,16 +34,27 @@
 #define N   r5
 #define VL  r6
 
+#define R27SAVE  (-40)
+#define R28SAVE  (-32)
+#define R29SAVE  (-24)
+#define R30SAVE  (-16)
+#define R31SAVE  (-8)
+
 ENTRY_TOCLESS (FUNC, 5)
-	std	r31, -8(r1)
+	std	r31, R31SAVE(r1)
 	rldicl.	r0, N, 0, 62
-	std	r30, -16(r1)
+	std	r30, R30SAVE(r1)
 	cmpdi	VL, r0, 2
-	std	r29, -24(r1)
+	std	r29, R29SAVE(r1)
 	addi	N, N, 3
-	std	r28, -32(r1)
+	std	r28, R28SAVE(r1)
 	srdi	N, N, 2
-	std	r27, -40(r1)
+	std	r27, R27SAVE(r1)
+	cfi_offset(r31, R31SAVE)
+	cfi_offset(r30, R30SAVE)
+	cfi_offset(r29, R29SAVE)
+	cfi_offset(r28, R28SAVE)
+	cfi_offset(r27, R27SAVE)
 	mtctr	N
 	beq	cr0, L(b00)
 	blt	cr6, L(b01)
@@ -199,10 +210,10 @@ L(end):	mulld	r0, r9, VL
 	addic	r11, r11, 1
 #endif
 	addze	RP, r8
-	ld	r31, -8(r1)
-	ld	r30, -16(r1)
-	ld	r29, -24(r1)
-	ld	r28, -32(r1)
-	ld	r27, -40(r1)
+	ld	r31, R31SAVE(r1)
+	ld	r30, R30SAVE(r1)
+	ld	r29, R29SAVE(r1)
+	ld	r28, R28SAVE(r1)
+	ld	r27, R27SAVE(r1)
 	blr
 END(FUNC)
diff --git a/sysdeps/powerpc/powerpc64/lshift.S b/sysdeps/powerpc/powerpc64/lshift.S
index 8b6396ee6c..855d6f2993 100644
--- a/sysdeps/powerpc/powerpc64/lshift.S
+++ b/sysdeps/powerpc/powerpc64/lshift.S
@@ -26,11 +26,15 @@
 #define TNC      r0
 #define U0      r30
 #define U1      r31
+#define U0SAVE  (-16)
+#define U1SAVE  (-8)
 #define RETVAL   r5
 
 ENTRY_TOCLESS (__mpn_lshift, 5)
-	std	U1, -8(r1)
-	std	U0, -16(r1)
+	std	U1, U1SAVE(r1)
+	std	U0, U0SAVE(r1)
+	cfi_offset(U1, U1SAVE)
+	cfi_offset(U0, U0SAVE)
 	subfic	TNC, CNT, 64
 	sldi	r7, N, RP
 	add	UP, UP, r7
@@ -170,8 +174,8 @@ L(cj3):	or	r10, r12, r7
 L(cj2):	std	r10, -32(RP)
 	std	r8, -40(RP)
 
-L(ret):	ld	U1, -8(r1)
-	ld	U0, -16(r1)
+L(ret):	ld	U1, U1SAVE(r1)
+	ld	U0, U0SAVE(r1)
 	mr	RP, RETVAL
 	blr
 END(__mpn_lshift)
diff --git a/sysdeps/powerpc/powerpc64/mul_1.S b/sysdeps/powerpc/powerpc64/mul_1.S
index 953ded8028..cade365258 100644
--- a/sysdeps/powerpc/powerpc64/mul_1.S
+++ b/sysdeps/powerpc/powerpc64/mul_1.S
@@ -24,9 +24,14 @@
 #define N   r5
 #define VL  r6
 
+#define R26SAVE  (-48)
+#define R27SAVE  (-40)
+
 ENTRY_TOCLESS (__mpn_mul_1, 5)
-	std	r27, -40(r1)
-	std	r26, -48(r1)
+	std	r27, R27SAVE(r1)
+	std	r26, R26SAVE(r1)
+	cfi_offset(r27, R27SAVE)
+	cfi_offset(r26, R26SAVE)
 	li	r12, 0
 	ld	r26, 0(UP)
 
@@ -129,7 +134,7 @@ L(end):	mulld	r0, r26, VL
 	std	r0, 0(RP)
 	std	r7, 8(RP)
 L(ret):	addze	RP, r8
-	ld	r27, -40(r1)
-	ld	r26, -48(r1)
+	ld	r27, R27SAVE(r1)
+	ld	r26, R26SAVE(r1)
 	blr
 END(__mpn_mul_1)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
index c8cb7edf77..fa769add4d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
@@ -29,6 +29,7 @@ ENTRY (__brk)
 	CALL_MCOUNT 1
 
 	std	r3,-8(r1)
+	cfi_offset(r3, -8)
 	DO_CALL(SYS_ify(brk))
 	ld	r6,-8(r1)
 	ld	r5,.LC__curbrk@toc(r2)
-- 
2.14.4

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

* Re: [PATCH] powerpc: Add missing CFI register information [BZ #23614]
  2018-09-06 21:43 [PATCH] powerpc: Add missing CFI register information [BZ #23614] Tulio Magno Quites Machado Filho
@ 2018-09-28 19:01 ` Gabriel F. T. Gomes
  2018-12-12 13:23   ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel F. T. Gomes @ 2018-09-28 19:01 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho; +Cc: libc-alpha

On Thu, 06 Sep 2018, Tulio Magno Quites Machado Filho wrote:

>	[BZ #23614]
>	* sysdeps/powerpc/powerpc64/addmul_1.S (FUNC): Add CFI offset for
>	registers saved in the stack frame.
>	* sysdeps/powerpc/powerpc64/lshift.S (__mpn_lshift): Likewise.
>	* sysdeps/powerpc/powerpc64/mul_1.S (__mpn_mul_1): Likewise.

OK

>	* sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S (__brk): Likewise.
> (...)
>diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>index c8cb7edf77..fa769add4d 100644
>--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>@@ -29,6 +29,7 @@ ENTRY (__brk)
> 	CALL_MCOUNT 1
> 
> 	std	r3,-8(r1)
>+	cfi_offset(r3, -8)
> 	DO_CALL(SYS_ify(brk))
> 	ld	r6,-8(r1)
> 	ld	r5,.LC__curbrk@toc(r2)


As mentioned in https://sourceware.org/bugzilla/show_bug.cgi?id=23614#c1,
this is not needed.

Looks good to me with this hunk removed and ChangeLog updated.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>

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

* Re: [PATCH] powerpc: Add missing CFI register information [BZ #23614]
  2018-09-28 19:01 ` Gabriel F. T. Gomes
@ 2018-12-12 13:23   ` Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-12-12 13:23 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

"Gabriel F. T. Gomes" <gabriel@inconstante.eti.br> writes:

> On Thu, 06 Sep 2018, Tulio Magno Quites Machado Filho wrote:
>
>>diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>>index c8cb7edf77..fa769add4d 100644
>>--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>>+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
>>@@ -29,6 +29,7 @@ ENTRY (__brk)
>> 	CALL_MCOUNT 1
>> 
>> 	std	r3,-8(r1)
>>+	cfi_offset(r3, -8)
>> 	DO_CALL(SYS_ify(brk))
>> 	ld	r6,-8(r1)
>> 	ld	r5,.LC__curbrk@toc(r2)
>
>
> As mentioned in https://sourceware.org/bugzilla/show_bug.cgi?id=23614#c1,
> this is not needed.
>
> Looks good to me with this hunk removed and ChangeLog updated.
>
> Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>

Removed and pushed as 1d880d4a9bf7608c2cd33bbe954ce6995f79121a.

Thanks!

-- 
Tulio Magno

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

end of thread, other threads:[~2018-12-12 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 21:43 [PATCH] powerpc: Add missing CFI register information [BZ #23614] Tulio Magno Quites Machado Filho
2018-09-28 19:01 ` Gabriel F. T. Gomes
2018-12-12 13:23   ` Tulio Magno Quites Machado Filho

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).