Re: Using C as a back end

Tom Payne <thp@cs.ucr.edu>
31 Oct 2000 14:39:23 -0500

          From comp.compilers

Related articles
[14 earlier articles]
Re: Using C as a back end ONeillCJ@logica.com (Conor O'Neill) (2000-10-26)
Re: Using C as a back end kst@cts.com (Keith Thompson) (2000-10-26)
Re: Using C as a back end jacob@jacob.remcomp.fr (jacob navia) (2000-10-26)
Re: Using C as a back end nr@labrador.eecs.harvard.edu (2000-10-31)
Re: Using C as a back end sweeks@my-deja.com (Stephen T. Weeks) (2000-10-31)
Re: Using C as a back end zs@ender.cs.mu.oz.au (2000-10-31)
Re: Using C as a back end thp@cs.ucr.edu (Tom Payne) (2000-10-31)
Re: Using C as a back end engler@Stanford.EDU (2000-10-31)
Re: Using C as a back end anton@mips.complang.tuwien.ac.at (2000-10-31)
Re: Using C as a back end joachim_d@gmx.de (Joachim Durchholz) (2000-10-31)
Re: Using C as a back end conway@ender.cs.mu.oz.au (2000-11-01)
Re: Using C as a back end kst@cts.com (Keith Thompson) (2000-11-01)
Re: Using C as a back end rhyde@cs.ucr.edu (Randall Hyde) (2000-11-01)
[8 later articles]
| List of all articles for this month |
From: Tom Payne <thp@cs.ucr.edu>
Newsgroups: comp.compilers
Date: 31 Oct 2000 14:39:23 -0500
Organization: University of California, Riverside
References: 00-10-148 00-10-154 00-10-212
Keywords: C
Posted-Date: 31 Oct 2000 14:39:23 EST

Keith Thompson <kst@cts.com> wrote:
> Peter Gammie <peteg@cse.unsw.edu.au> writes:
> [...]
>> The biggest problem with compiling to C is its lack of
>> expressiveness; almost certainly you'll want to use gcc's extensions
>> (such as goto), unless your language is already close to C.


> Just to clarify, goto is part of the standard C language, not a gcc
> extension. gcc does provide computed gotos, though, which standard C
> lacks. (Whether this is a good thing is a can of worms I choose not
> to open.)


For many applications, indirect jumps (computed gotos) are essential.
gcc allows a program to load a label L into a void* pointer p via the
expression p=&&L. One can then goto L via the statement goto *p;
There are, however, ways to fake this sort of thing in Standard C/C++
by using a switch statement.


Tom Payne
[Once again, an indirect jump is, in Fortran-ese, an assigned goto.
Or if you speak Cobol, it's an ALTERed goto. -John]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.