Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-23 Thread Ramana Radhakrishnan



On 16/06/15 22:25, James Lemke wrote:

A divide by zero exception was not giving a proper traceback for LINUX
ARM_EABI.  The attached patch fixes the problem on trunk (and several
local branches).

Tested on gcc-trunk for arm-none-linux-gnueabi.

OK to commit?

2015-06-16  James Lemke  jwle...@codesourcery.com

libgcc/config/arm/
* lib1funcs.S (aeabi_idiv0, aeabi_ldiv0): Add CFI entries for
Linux ARM_EABI.


s/for Linux ARM EABI//

given you handle both __ARM_EABI__ and the not __ARM_EABI__ targets in 
the source.


This is OK if no regressions.

Thanks,
Ramana


Fwd: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-23 Thread James Lemke

Ping..


 Forwarded Message 
Subject: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
Date: Tue, 16 Jun 2015 17:25:49 -0400
From: James Lemke jwle...@codesourcery.com
To: gcc-patches@gcc.gnu.org

A divide by zero exception was not giving a proper traceback for LINUX
ARM_EABI.  The attached patch fixes the problem on trunk (and several
local branches).

Tested on gcc-trunk for arm-none-linux-gnueabi.

OK to commit?

--
Jim Lemke, GNU Tools Sourcerer
Mentor Graphics / CodeSourcery
Orillia, Ontario



2015-06-16  James Lemke  jwle...@codesourcery.com

	libgcc/config/arm/
	* lib1funcs.S (aeabi_idiv0, aeabi_ldiv0): Add CFI entries for
	Linux ARM_EABI.

Index: libgcc/config/arm/lib1funcs.S
===
--- libgcc/config/arm/lib1funcs.S	(revision 224523)
+++ libgcc/config/arm/lib1funcs.S	(working copy)
@@ -1336,23 +1336,30 @@ LSYM(Lover12):
 #define SIGFPE	8
 
 #ifdef __ARM_EABI__
+	cfi_start	__aeabi_ldiv0, LSYM(Lend_aeabi_ldiv0)
 	WEAK aeabi_idiv0
 	WEAK aeabi_ldiv0
 	ARM_FUNC_START aeabi_idiv0
 	ARM_FUNC_START aeabi_ldiv0
+	do_push	{r1, lr}
+98:	cfi_push 98b - __aeabi_ldiv0, 0xe, -0x4, 0x8
 #else
+	cfi_start	__div0, LSYM(Lend_div0)
 	ARM_FUNC_START div0
+	do_push	{r1, lr}
+98:	cfi_push 98b - __div0, 0xe, -0x4, 0x8
 #endif
 
-	do_push	{r1, lr}
 	mov	r0, #SIGFPE
 	bl	SYM(raise) __PLT__
-	RETLDM	r1
+	RETLDM	r1 unwind=98b
 
 #ifdef __ARM_EABI__
+	cfi_end	LSYM(Lend_aeabi_ldiv0)
 	FUNC_END aeabi_ldiv0
 	FUNC_END aeabi_idiv0
 #else
+	cfi_end	LSYM(Lend_div0)
 	FUNC_END div0
 #endif
 	



Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-23 Thread James Lemke



Tested on gcc-trunk for arm-none-linux-gnueabi.

OK to commit?



2015-06-16  James Lemke  jwle...@codesourcery.com

libgcc/config/arm/
* lib1funcs.S (aeabi_idiv0, aeabi_ldiv0): Add CFI entries for
Linux ARM_EABI.


s/for Linux ARM EABI//

given you handle both __ARM_EABI__ and the not __ARM_EABI__ targets in
the source.

This is OK if no regressions.


I saw no regressions for arm-none-linux-gnueabi.
However, I don't have access to a non-eabi linux target.
Shall I commit with the non-eabi portions or remove them?
Jim.

--
Jim Lemke, GNU Tools Sourcerer
Mentor Graphics / CodeSourcery
Orillia, Ontario


Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-23 Thread Ramana Radhakrishnan
On Tue, Jun 23, 2015 at 5:18 PM, James Lemke jwle...@codesourcery.com wrote:

 Tested on gcc-trunk for arm-none-linux-gnueabi.

 OK to commit?


 2015-06-16  James Lemke  jwle...@codesourcery.com

 libgcc/config/arm/
 * lib1funcs.S (aeabi_idiv0, aeabi_ldiv0): Add CFI entries for
 Linux ARM_EABI.


 s/for Linux ARM EABI//

 given you handle both __ARM_EABI__ and the not __ARM_EABI__ targets in
 the source.

 This is OK if no regressions.


 I saw no regressions for arm-none-linux-gnueabi.
 However, I don't have access to a non-eabi linux target.
 Shall I commit with the non-eabi portions or remove them?
 Jim.

I have no access to a non-EABI arm target to test this, not sure if
there are any intree anymore (probably vxworks ?) .  It looks sane on
a read - just apply it and look after regressions if anything gets
reported in bugzilla.


regards
Ramana



 --
 Jim Lemke, GNU Tools Sourcerer
 Mentor Graphics / CodeSourcery
 Orillia, Ontario


Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-23 Thread James Lemke

On 06/23/2015 12:22 PM, Ramana Radhakrishnan wrote:

I have no access to a non-EABI arm target to test this, not sure if
there are any intree anymore (probably vxworks ?) .  It looks sane on
a read - just apply it and look after regressions if anything gets
reported in bugzilla.


Thanks Ramana.  I will change the CL entry as you suggested.
Jim.

--
Jim Lemke, GNU Tools Sourcerer
Mentor Graphics / CodeSourcery
Orillia, Ontario


[PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0

2015-06-16 Thread James Lemke

A divide by zero exception was not giving a proper traceback for LINUX
ARM_EABI.  The attached patch fixes the problem on trunk (and several
local branches).

Tested on gcc-trunk for arm-none-linux-gnueabi.

OK to commit?

--
Jim Lemke, GNU Tools Sourcerer
Mentor Graphics / CodeSourcery
Orillia, Ontario
2015-06-16  James Lemke  jwle...@codesourcery.com

	libgcc/config/arm/
	* lib1funcs.S (aeabi_idiv0, aeabi_ldiv0): Add CFI entries for
	Linux ARM_EABI.

Index: libgcc/config/arm/lib1funcs.S
===
--- libgcc/config/arm/lib1funcs.S	(revision 224523)
+++ libgcc/config/arm/lib1funcs.S	(working copy)
@@ -1336,23 +1336,30 @@ LSYM(Lover12):
 #define SIGFPE	8
 
 #ifdef __ARM_EABI__
+	cfi_start	__aeabi_ldiv0, LSYM(Lend_aeabi_ldiv0)
 	WEAK aeabi_idiv0
 	WEAK aeabi_ldiv0
 	ARM_FUNC_START aeabi_idiv0
 	ARM_FUNC_START aeabi_ldiv0
+	do_push	{r1, lr}
+98:	cfi_push 98b - __aeabi_ldiv0, 0xe, -0x4, 0x8
 #else
+	cfi_start	__div0, LSYM(Lend_div0)
 	ARM_FUNC_START div0
+	do_push	{r1, lr}
+98:	cfi_push 98b - __div0, 0xe, -0x4, 0x8
 #endif
 
-	do_push	{r1, lr}
 	mov	r0, #SIGFPE
 	bl	SYM(raise) __PLT__
-	RETLDM	r1
+	RETLDM	r1 unwind=98b
 
 #ifdef __ARM_EABI__
+	cfi_end	LSYM(Lend_aeabi_ldiv0)
 	FUNC_END aeabi_ldiv0
 	FUNC_END aeabi_idiv0
 #else
+	cfi_end	LSYM(Lend_div0)
 	FUNC_END div0
 #endif