diff mbox

Add CFI entries for ARM Linux idiv0 / ldiv0

Message ID 5580945D.4060608@codesourcery.com
State New
Headers show

Commit Message

James Lemke June 16, 2015, 9:25 p.m. UTC
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?

Comments

Ramana Radhakrishnan June 23, 2015, 2:58 p.m. UTC | #1
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  <jwlemke@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
James Lemke June 23, 2015, 4:18 p.m. UTC | #2
>> Tested on gcc-trunk for arm-none-linux-gnueabi.
>>
>> OK to commit?
>>>
>> 2015-06-16  James Lemke  <jwlemke@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.
Ramana Radhakrishnan June 23, 2015, 4:22 p.m. UTC | #3
On Tue, Jun 23, 2015 at 5:18 PM, James Lemke <jwlemke@codesourcery.com> wrote:
>
>>> Tested on gcc-trunk for arm-none-linux-gnueabi.
>>>
>>> OK to commit?
>>>>
>>>>
>>> 2015-06-16  James Lemke  <jwlemke@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
James Lemke June 23, 2015, 4:23 p.m. UTC | #4
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.
diff mbox

Patch

2015-06-16  James Lemke  <jwlemke@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