From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-17 01:38:54 PST Path: nntp.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!news.bu.edu!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: RISC Date: Fri, 16 Mar 2001 10:09:38 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3AB22CB2.E8A851A5@averstar.com> References: <98qumf$5sf$1@nh.pace.co.uk> <98r4g1$7r1$1@nh.pace.co.uk> NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 984755379 14641 141.199.8.77 (16 Mar 2001 15:09:39 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 16 Mar 2001 15:09:39 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: nntp.stanford.edu comp.lang.ada:91510 Date: 2001-03-16T15:09:39+00:00 List-Id: Marin David Condic wrote: > > Oh sure. Most garden variety representation clauses get listened to and > obeyed. At least in my experience. I just like to complain about the > inability to coerce behavior out of compilers sometimes. I know I've come up > with perfectly reasonable and legal representation specifications from time > to time and had them rejected by compilers because a) they didn't understand > what I wanted or b) they *did* understand and refused to do it because > obviously they knew better than I did what it is I *really* wanted, if only > I was as smart and omnipotent as the compiler. This is my cue to pipe up with the Compiler Writer's Lament. Rep clauses are difficult to support because every special case makes a compiler more complicated and more buggy, and makes optimization harder. So compilers really "want" to do everything one way if possible, and then optimize the heck out of that. With rep-clauses, the programmer is sometimes asking the compiler to violate some of its basic assumptions (e.g., the "tag" is always the first word of the record, the non-variant part precedes the entire variant part, every dynamic-sized component is dumped at the end of the record, with an offset word identifying where it starts, every object is aligned on its "natural" alignment boundary, bit fields never cross word boundaries, packed array components never cross byte boundaries, ...). Of course any one of these assumptions can be examined and declared stupid, and the compiler writer can be scolded for making any such assumptions. On the other hand, the programmer expects that if by chance there is an efficient way of implementing the specified representation, the compiler jolly-well better recognize that fact and do the right thing. E.g., allow me to specify fields that cross word boundaries, but if they don't, then do the efficient in-line field extract. I can assure you that we devote huge quantities of code in our compilers to dealing with programmer-specified representations, and still we find that there are some representations we can't handle. Sometimes we know it, so we reject the rep-clause. Sometimes we don't know it, and generate goofy or incorrect code. So feel a little sympathy for us, and/or get out your check books and pony up some big bucks for the ultimate in rep-clause support ;-). > That's when you have to get creative in the stories you tell to the > compiler! :-) > > MDC > -- > Marin David Condic > Senior Software Engineer > Pace Micro Technology Americas www.pacemicro.com > Enabling the digital revolution > e-Mail: marin.condic@pacemicro.com > Web: http://www.mcondic.com/ -- -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ Chief Technology Officer, AverCom Corporation (A Titan Company) Burlington, MA USA (AverCom was formerly the Commercial Division of AverStar: http://www.averstar.com/services/ebusiness_applications.html)