From mboxrd@z Thu Jan 1 00:00:00 1970 References: In-Reply-To: Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-523DFD36-4DC4-43B7-BD4E-19F2E7EB4CAE Message-Id: <561264DD-3FF2-4FD9-82FD-78DC12DE3F05@bitblocks.com> Content-Transfer-Encoding: 7bit From: Bakul Shah Date: Wed, 18 Jan 2012 09:48:28 -0800 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] assembly syntax in plan 9 Topicbox-Message-UUID: 5e5d8c64-ead7-11e9-9d60-3106f5b1d025 --Apple-Mail-523DFD36-4DC4-43B7-BD4E-19F2E7EB4CAE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 17, 2012, at 11:21 AM, Comeau At9Fans wrote= : > On Mon, Jan 16, 2012 at 2:03 PM, Bakul Shah wrote: > How do you deal with longjmp? >=20 > I don't have it in front of me, but I do seem to recall the Standard allow= s that the VLA might still be around though, believe it has an example with s= aid, for better or worse... Do you have a reference? > On Jan 16, 2012, at 10:51 AM, Comeau At9Fans wro= te: >> On Mon, Jan 16, 2012 at 10:41 AM, Bakul Shah wrote:= >> A frame pointer is needed for C99's variable length arrays but not otherw= ise. Only an issue if ever plan9 C is extended to handle C99 or C1x. gcc has= to do the right thing even with -fno-frame-pointer. >>=20 >> What we do in problematic cases with Comeau is to generate code to arrang= e for the allocation of the VLA on the heap. I'm not saying this is perfect= , but at least it gets the feature implementable and up and running as "a po= rtable implementation" versus perhaps not being able to implement it at all o= n some platforms. Seems to me if you can port C, you can use a FP to implement VLAs without al= loca games and more efficiently. You can always store the FP in stack local m= emory if out of registers.= --Apple-Mail-523DFD36-4DC4-43B7-BD4E-19F2E7EB4CAE Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=utf-8
On Jan 17, 2012, at 11:21 AM, Comeau At9Fans <comeauat9fans@gmail.com> wrote:

On Mon, Jan 16, 2012 at 2:03 PM, Bakul Shah <bakul@bitblocks.com> wrote:
How do you deal with longjmp?

I don't have it in front of me, but I do seem to recall the Standard allows that the VLA might still be around though, believe it has an example with said, for better or worse...

Do you have a reference?

On Jan 16, 2012, at 10:51 AM, Comeau At9Fans <comeauat9fans@gmail.com> wrote:
On Mon, Jan 16, 2012 at 10:41 AM, Bakul Shah <bakul@bitblocks.com> wrote:
A frame pointer is needed for C99's variable length arrays but not otherwise. Only an issue if ever plan9 C is extended to handle C99 or C1x. gcc has to do the right thing even with -fno-frame-pointer.

What we do in problematic cases with Comeau is to generate code to arrange for the allocation of the VLA on the heap.  I'm not saying this is perfect, but at least it gets the feature implementable and up and running as "a portable implementation" versus perhaps not being able to implement it at all on some platforms.

Seems to me if you can port C, you can use a FP to implement VLAs without alloca games and more efficiently. You can always store the FP in stack local memory if out of registers.
--Apple-Mail-523DFD36-4DC4-43B7-BD4E-19F2E7EB4CAE--