* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
@ 2003-11-27 0:32 ` David Mosberger
2003-11-27 1:12 ` Keith Owens
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2003-11-27 0:32 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 27 Nov 2003 11:12:18 +1100, Keith Owens <kaos@sgi.com> said:
Keith> I know that gcc 3.4 overcomes this problem by saving ar.pfs
Keith> in leaf functions and using br.call. However we need a fix
Keith> for gcc in the current distributions,
Sounds reasonable.
Keith> even with gcc 3.4 we may wish to use out of line code that
Keith> does not save ar.pfs in the future.
That would need a some solid argument!
Keith> We need a generic fix for unwinding through out of line code
Keith> called from leaf functions and not using br.call. The
Keith> obvious solution is to flag all out of line code with an
Keith> unwind abi field and have the common unwind code reset
Keith> ar.pfs. Can I use .unwabi 3, 'o' for out of line?
The .unwabi directive isn't appropriate for that. If you want such a
feature, please push it through the ABI committee to get it officially
supported. I've said that before, I think.
--david
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
2003-11-27 0:32 ` David Mosberger
@ 2003-11-27 1:12 ` Keith Owens
2003-11-27 1:34 ` David Mosberger
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Keith Owens @ 2003-11-27 1:12 UTC (permalink / raw)
To: linux-ia64
On Wed, 26 Nov 2003 16:32:00 -0800,
David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>> On Thu, 27 Nov 2003 11:12:18 +1100, Keith Owens <kaos@sgi.com> said:
> Keith> We need a generic fix for unwinding through out of line code
> Keith> called from leaf functions and not using br.call. The
> Keith> obvious solution is to flag all out of line code with an
> Keith> unwind abi field and have the common unwind code reset
> Keith> ar.pfs. Can I use .unwabi 3, 'o' for out of line?
>
>The .unwabi directive isn't appropriate for that. If you want such a
>feature, please push it through the ABI committee to get it officially
>supported. I've said that before, I think.
I disagree, unwabi is exactly what we need for this. The out of line
code is peculiar to Linux, and uses the Linux pt_regs to get the real
ar.pfs. .unwabi 3,i indicates a Linux interrupt frame with all state
in pt_regs, .unwabi 3,o indicates a Linux out of line frame with
pt_regs.ar_pfs containing the real ar.pfs. If unwabi 3,i is valid then
so is unwabi 3,o.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
2003-11-27 0:32 ` David Mosberger
2003-11-27 1:12 ` Keith Owens
@ 2003-11-27 1:34 ` David Mosberger
2003-11-27 4:28 ` David Mosberger
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2003-11-27 1:34 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 27 Nov 2003 12:12:56 +1100, Keith Owens <kaos@sgi.com> said:
Keith> On Wed, 26 Nov 2003 16:32:00 -0800,
Keith> David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>>> On Thu, 27 Nov 2003 11:12:18 +1100, Keith Owens <kaos@sgi.com> said:
Keith> We need a generic fix for unwinding through out of line code
Keith> called from leaf functions and not using br.call. The
Keith> obvious solution is to flag all out of line code with an
Keith> unwind abi field and have the common unwind code reset
Keith> ar.pfs. Can I use .unwabi 3, 'o' for out of line?
>> The .unwabi directive isn't appropriate for that. If you want such a
>> feature, please push it through the ABI committee to get it officially
>> supported. I've said that before, I think.
Keith> I disagree, unwabi is exactly what we need for this. The out
Keith> of line code is peculiar to Linux, and uses the Linux pt_regs
Keith> to get the real ar.pfs. .unwabi 3,i indicates a Linux
Keith> interrupt frame with all state in pt_regs, .unwabi 3,o
Keith> indicates a Linux out of line frame with pt_regs.ar_pfs
Keith> containing the real ar.pfs. If unwabi 3,i is valid then so
Keith> is unwabi 3,o.
If you want to support out-of-line code, do it right or don't it at
all. There is no chance in hell I'm going to accept such hacks and I
also won't bother supporting such gross hacks in libunwind. EOD.
--david
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
` (2 preceding siblings ...)
2003-11-27 1:34 ` David Mosberger
@ 2003-11-27 4:28 ` David Mosberger
2003-11-27 6:52 ` Jim Wilson
2003-12-11 1:21 ` David Mosberger
5 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2003-11-27 4:28 UTC (permalink / raw)
To: linux-ia64
I forgot to mention this:
>>>>> On Thu, 27 Nov 2003 11:12:18 +1100, Keith Owens <kaos@sgi.com> said:
Keith> I know that gcc 3.4 overcomes this problem by saving ar.pfs
Keith> in leaf functions and using br.call.
gcc-3.3.2 also can handle ar.pfs clobbers, so we may just want to
update the kernel code to be a bit more premissive and not insist on
>= gcc-3.4. I'm not exactly sure though when this got fixed, so
somebody would have to look into that first.
--david
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
` (3 preceding siblings ...)
2003-11-27 4:28 ` David Mosberger
@ 2003-11-27 6:52 ` Jim Wilson
2003-12-11 1:21 ` David Mosberger
5 siblings, 0 replies; 7+ messages in thread
From: Jim Wilson @ 2003-11-27 6:52 UTC (permalink / raw)
To: linux-ia64
On Wed, 2003-11-26 at 20:28, David Mosberger wrote:
> gcc-3.3.2 also can handle ar.pfs clobbers, so we may just want to
> update the kernel code to be a bit more premissive and not insist on
> >= gcc-3.4. I'm not exactly sure though when this got fixed, so
> somebody would have to look into that first.
The patch is in gcc-3.3.0. See Richard Henderson's 2003-04-26 ia64
change in gcc. However, that patch resulted in an ICE in some other
cases, and unnecessary saves/restores of ar.pfs, see gcc PR 10681. The
patch for that is in gcc-3.3.1. See Richard Henderson's 2003-06-26
change in gcc.
It would be reasonable to just check for >= gcc-3.3 for use of this
feature. I wouldn't recommend using gcc-3.3.0 though.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Unwind bug on out of line code called from leaf functions
2003-11-27 0:12 Unwind bug on out of line code called from leaf functions Keith Owens
` (4 preceding siblings ...)
2003-11-27 6:52 ` Jim Wilson
@ 2003-12-11 1:21 ` David Mosberger
5 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2003-12-11 1:21 UTC (permalink / raw)
To: linux-ia64
>>>>> On 26 Nov 2003 22:52:50 -0800, Jim Wilson <wilson@specifixinc.com> said:
Jim> On Wed, 2003-11-26 at 20:28, David Mosberger wrote:
>> gcc-3.3.2 also can handle ar.pfs clobbers, so we may just want to
>> update the kernel code to be a bit more premissive and not insist
>> on >= gcc-3.4. I'm not exactly sure though when this got fixed,
>> so somebody would have to look into that first.
Jim> The patch is in gcc-3.3.0. See Richard Henderson's 2003-04-26
Jim> ia64 change in gcc. However, that patch resulted in an ICE in
Jim> some other cases, and unnecessary saves/restores of ar.pfs, see
Jim> gcc PR 10681. The patch for that is in gcc-3.3.1. See Richard
Jim> Henderson's 2003-06-26 change in gcc.
Jim> It would be reasonable to just check for >= gcc-3.3 for use of
Jim> this feature. I wouldn't recommend using gcc-3.3.0 though.
OK, I'm changing the kernel now to check for >= gcc-3.3.
Thanks!
--david
^ permalink raw reply [flat|nested] 7+ messages in thread