public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
@ 2015-06-16 21:48 James Lemke
  2015-06-23 14:01 ` Fwd: " James Lemke
  2015-06-23 15:00 ` Ramana Radhakrishnan
  0 siblings, 2 replies; 6+ messages in thread
From: James Lemke @ 2015-06-16 21:48 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

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

[-- Attachment #2: cb4820-gcc-0616a.diff --]
[-- Type: text/x-diff, Size: 1050 bytes --]

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
 	

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

* Fwd: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
  2015-06-16 21:48 [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0 James Lemke
@ 2015-06-23 14:01 ` James Lemke
  2015-06-23 15:00 ` Ramana Radhakrishnan
  1 sibling, 0 replies; 6+ messages in thread
From: James Lemke @ 2015-06-23 14:01 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

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 <jwlemke@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




[-- Attachment #2: cb4820-gcc-0616a.diff --]
[-- Type: text/x-diff, Size: 1051 bytes --]

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
 	


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

* Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
  2015-06-16 21:48 [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0 James Lemke
  2015-06-23 14:01 ` Fwd: " James Lemke
@ 2015-06-23 15:00 ` Ramana Radhakrishnan
  2015-06-23 16:22   ` James Lemke
  1 sibling, 1 reply; 6+ messages in thread
From: Ramana Radhakrishnan @ 2015-06-23 15:00 UTC (permalink / raw)
  To: James Lemke, gcc-patches



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

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

* Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
  2015-06-23 15:00 ` Ramana Radhakrishnan
@ 2015-06-23 16:22   ` James Lemke
  2015-06-23 16:24     ` Ramana Radhakrishnan
  0 siblings, 1 reply; 6+ messages in thread
From: James Lemke @ 2015-06-23 16:22 UTC (permalink / raw)
  To: Ramana Radhakrishnan, gcc-patches


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

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

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

* Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
  2015-06-23 16:22   ` James Lemke
@ 2015-06-23 16:24     ` Ramana Radhakrishnan
  2015-06-23 16:27       ` James Lemke
  0 siblings, 1 reply; 6+ messages in thread
From: Ramana Radhakrishnan @ 2015-06-23 16:24 UTC (permalink / raw)
  To: James Lemke; +Cc: Ramana Radhakrishnan, gcc-patches

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

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

* Re: [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0
  2015-06-23 16:24     ` Ramana Radhakrishnan
@ 2015-06-23 16:27       ` James Lemke
  0 siblings, 0 replies; 6+ messages in thread
From: James Lemke @ 2015-06-23 16:27 UTC (permalink / raw)
  To: ramrad01; +Cc: Ramana Radhakrishnan, gcc-patches

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

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

end of thread, other threads:[~2015-06-23 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 21:48 [PATCH] Add CFI entries for ARM Linux idiv0 / ldiv0 James Lemke
2015-06-23 14:01 ` Fwd: " James Lemke
2015-06-23 15:00 ` Ramana Radhakrishnan
2015-06-23 16:22   ` James Lemke
2015-06-23 16:24     ` Ramana Radhakrishnan
2015-06-23 16:27       ` James Lemke

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