From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,7223de97ebf14372 X-Google-Attributes: gid1164f8,public X-Google-Thread: f7344,7223de97ebf14372 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2002-01-11 13:37:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!uunet!lax.uu.net!sac.uu.net!news.compaq.com!news.cpqcorp.net!not-for-mail Newsgroups: comp.os.vms,comp.sys.dec Distribution: world X-Newsreader: mxrn 6.18-32B References: <3q4r2uc6ad3r4kbclnejf61fn08q5po4ie@4ax.com> <00A07554.69119936@SendSpamHere.ORG> <87advyq2as.fsf@prep.synonet.com> <3C3A146D.9BF412F9@videotron.ca> <5b86b9ee.0201111206.6c71f856@posting.google.com> From: hoffman@xdelta.zko.dec.nospam (Hoff Hoffman) Reply-To: hoffman@xdelta.zko.dec.nospam Subject: Re: Bugs and Optimization (was: Re: VMS on more common hardware...) Message-ID: Date: Fri, 11 Jan 2002 21:37:51 GMT NNTP-Posting-Host: 16.32.80.251 X-Complaints-To: abuse@Compaq.com X-Trace: news.cpqcorp.net 1010785071 16.32.80.251 (Fri, 11 Jan 2002 13:37:51 PST) NNTP-Posting-Date: Fri, 11 Jan 2002 13:37:51 PST Organization: Compaq Computer Corporation Xref: archiver1.google.com comp.os.vms:60014 comp.sys.dec:11442 JF Mezei wrote in message news:<3C3A146D.9BF412F9@videotron.ca>... : When writing kernel code or deep down stuff for the OS, does using a : compiler with lots of optimization for the harware ever cause serious : problems ? Ever? Sure. But that is not particularly meaningful answer, of course. I've debugged bugs that were latent, and that that were uncovered by the optimizer -- in entirely user-mode code. The failures do tend to be more dramatic within kernel-mode code of course, but the potential for problems is not specific to the operating system nor to privileged-mode code. (Most any optimizer tends to be a useful tool for uncovering latent code bugs, after all. More than a few programmers have blamed the compiler or the optimizer for these latent bugs, too -- the first time I coded one of these bugs, I blamed the optimizer. This is not to say that the optimizer can't ever introduce bugs, I've seen that happen too.) : (I am thinking of instruction ordering, and variable "elimination" by : keeping them in registers, and possible many other factors). The Alpha real-time or shared-memory programmer must be familiar with the sequence points and with the trap and memory constructs barriers -- not only the compiler, but the microprocessor can also re-order and can also cache stuff. This is nothing particularly new -- various VAX boxes have similar considerations. For an introduction into some of the usual sorts of programming mistakes and considerations, please review topics (1661), (2681), (4647) and (6099) over in the Ask The Wizard area. These are an introduction, of course. There are language keywords around that will keep a variable in memory (and not in a register; eg: "volatile") -- volatile-like keywords are particularly useful for I/O space references. (You must be careful to have the correct widget marked as volatile, too. You probably don't want to end up with a memory-based pointer to an object stored in a register, of course. :-) Volatile doesn't help with memory caching and memory access resequencing, however... There is a list of the hardware instructions that are available in I/O space listed in the documentation set -- related information in the manuals can provide details, as can the usual discussions around shared memory and synchronization techniques. The circa-1982 VAX hardware manual had such a list, and the second edition of the VAX Architecture Manual (1987, 1991) has I/O space reference details on pages 321 and 322. As a start, please read and heed the OpenVMS Programming Concepts manual. ---------------------------- #include ----------------------------- For additional, please see the OpenVMS FAQ -- www.openvms.compaq.com --------------------------- pure personal opinion --------------------------- Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com