This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SIMPLE: A language-independent tree IR


Richard Henderson wrote:

> On Wed, Jan 02, 2002 at 02:46:28PM -0700, Tom Tromey wrote:
>>Why do we need all those trees when we already have _EXPR versions of
>>them?
 
> We should get rid of the EXPR versions.


No, we should get rid of the _STMT versions, as the EXPR versions are
more general than the EXPR versions, and the STMT versions duplicate
existing functionality.

 > A goto is not an expression
 > in any language that we're targeting, nor do we derive any benefit
 > from considering them expressions.

Perhaps not, but for most of the other _STMT nodes it is perfectly
reasonable to use them as expressions, and there are existing
languages out there where such forms *are* expressions, including
most languages in the Lisp family.  For example a SWITCH_STMT is just
a restricted version of a SWITCH_EXPR.  RETURN_STMT, BREAK_STMT, and 
CONTINUE_STMT are all special cases of EXIT_BLOCK_EXPR.  The
FOR_STMT, WHILE_STMT. and DO_STMT are all special cases of a more
general LOOP_EXPR.  It seems silly to implement support for the
restricted versions when that uses more code than just implementing
the general case.

PLease let's not needlessly tie gcc to primitive old-fashioned
statement-oriented languages like C, C++ - or for that matter Java.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]