[M3devel] comparisons and subranges
Jay K
jay.krell at cornell.edu
Sat Oct 20 21:05:08 CEST 2012
Typecode = [0 .. 16_FFFFF]; (* can fit in 20 bits *)tc: Typecode.
IF (tc # RTType.NoSuchType) AND (0 <= tc) AND (tc < n) THEN
if(((INT64)(((INT64)(M3_INT64(0)))))>((INT64)(((INT64)(*(UINT32*)(&tc_L_68))))))goto L4F;
gcc:../src/runtime/common/RTutils.m3:233: warning: comparison is always false due to limited range of data type
I'd like to be warning-free.I think this is the only class of warning I have now.
Thoughts?
Could the frontend eliminate some of this stuff?
Otherwise I might do constant-folding in the C backend.
I had offered a patch months ago that would do some simple stuff in the frontendinvolving comparisons and subranges.Try that again?(i.e. see how many warnings it removes, see if it suffices?)
I might just try hiding constants inside functions for now, at least zero since it is the biggest offender:.static int Zero(void) { return 0; }
Thanks, - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20121020/6c9d22f5/attachment-0001.html>
More information about the M3devel
mailing list