From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <561264DD-3FF2-4FD9-82FD-78DC12DE3F05@bitblocks.com> References: <561264DD-3FF2-4FD9-82FD-78DC12DE3F05@bitblocks.com> Date: Wed, 18 Jan 2012 13:32:37 -0500 Message-ID: From: Comeau At9Fans To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=20cf303f6d060afe2604b6d1acea Subject: Re: [9fans] assembly syntax in plan 9 Topicbox-Message-UUID: 5e627724-ead7-11e9-9d60-3106f5b1d025 --20cf303f6d060afe2604b6d1acea Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 18, 2012 at 12:48 PM, Bakul Shah wrote: > 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? >> > > 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? > Ok, so, gunna make me look, let's see, ok: 7.13.2.1p5, note the may's and might's. There should be narrative backing those up. > On Jan 16, 2012, at 10:51 AM, Comeau At9Fans >> wrote: >> >> 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 >>> 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. > I probably overstated the situation by saying not being able to implement it at all... probably should have said I never thought of it beyond the obvious implementations. -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it? --20cf303f6d060afe2604b6d1acea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Jan 18, 2012 at 12:48 PM, Bakul Shah <bakul@bitblocks.com> wrote:
On Jan 17, 2012, at 11:21 A= M, 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 s= eem 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?=

Ok, so, gunna make me look, le= t's see, ok: 7.13.2.1p5, note the may's and might's. =A0There s= hould be narrative backing those up.
=A0
On Jan 16, 2012, at 10:51 AM, Comea= u At9Fans <= comeauat9fans@gmail.com> wrote:
On Mo= n, Jan 16, 2012 at 10:41 AM, Bakul Shah <bakul@bitblocks.com> wrote:
A frame pointer is needed for C99's varia= ble length arrays but not otherwise. Only an issue if ever plan9 C is exten= ded to handle C99 or C1x. gcc has to do the right thing even with -fno-fram= e-pointer.

What we do in problematic cases with= Comeau is to generate code to arrange for the allocation of the VLA on the= heap. =A0I'm not saying this is perfect, but at least it gets the feat= ure implementable and up and running as "a portable implementation&quo= t; versus perhaps not being able to implement it at all on some platforms.<= /div>

Seems to me if you can port C, you = can use a FP to implement VLAs without alloca games and more efficiently. Y= ou can always store the FP in stack local memory if out of registers.

I probably overstated the situation by saying = not being able to implement it at all... probably should have said I never = thought of it beyond the obvious implementations.
--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
<= div>Comeau C/C++ ONLINE =3D=3D> =A0 =A0 http://www.comeaucomputing.com/tryito= ut
World Class Compilers: =A0Breathtaking C++, Amazing C99, Fabulous C90.=
Comeau C/C++ with Dinkumware's Libraries... Have you tried i= t?

--20cf303f6d060afe2604b6d1acea--