[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sun Mar 14 06:29:39 CET 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/03/14 06:29:39

Modified files:
	cm3/m3-sys/m3front/src/exprs/: CompareExpr.m3 EqualExpr.m3 

Log message:
	go back a version
	the codegen optimization is ok, but I confused "semantically const"
	with "opportunistically const"
	
	e.g. the following is not legal C:
	
	const int a = 1; /* ok */
	const int b = a + 1; /* not ok */
	int c[a]; /* not ok */
	int F() { return 1; } /* ok */
	int d = F(); /* not ok */
	int e[F()]; /* not ok */
	
	(I'm assuming c89 or such, not c9x.)
	
	compiler could optimize:
	
	int F1() { return 1; }
	int F2() { return F() + F1(); } /* => return 2 */
	
	but that occurs "differently".




More information about the M3commit mailing list