From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,10b7a9a3731f3fc8 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1125fa,10b7a9a3731f3fc8 X-Google-Attributes: gid1125fa,public X-Google-Thread: fb9cd,10b7a9a3731f3fc8 X-Google-Attributes: gidfb9cd,public X-Google-Thread: f782f,10b7a9a3731f3fc8 X-Google-Attributes: gidf782f,public From: Dirk Grunwald Subject: Re: Alpha Dead? Naaahhhh.... (was Re: Is there a list of Alpha NT applications anywhere?) Date: 1997/12/17 Message-ID: #1/1 X-Deja-AN: 299028020 References: <34915AEE.41C6@atlas.cheme.cornell.edu> <3491F2D7.28E3@videotron.ca> <3491FFE2.E1D71B82@cgocable.net> <66u8pn$833@usenet.srv.cis.pitt.edu> <3492CA68.16C7916C@cgocable.net> <34955C3B.167E@atlas.cheme.cornell.edu> <01bd0a54$17733a00$8404a8c0@ant> Organization: University of Colorado Newsgroups: comp.os.ms-windows.nt.admin.misc,comp.os.ms-windows.nt.advocacy,comp.sys.dec,comp.os.ms-windows.nt.misc Ketil Z Malde writes: > Shouldn't a working compiler either: > > compile the program to working object code for all cases of > optimization and or debugging options > or > issue an error message to the effect that the program is illegal? -- There are cases where this is impossible, or not defined in the language. Consider the following: foo() { int a; bar(&a);} bar(int *x) { x[0] = 1; x[1] = 2; } You can generalize this example such that the precise information you need from flow analysis is clearly not available. In this particular example, the error will be shown depending on the stack layout of the frame in procedure 'foo'. When not optimizing, all of the variables in 'foo' would be allocate to the stack, creating a large frame -- and the code might not immediately die. With optimization, more variables are promoted to registers, resulting in a shorter frame. It's more likely that 'bar' will overwrite e.g.., the return stack information in the frame, leading to an obvious error. Some of these kinds of problems are related to weak type checking in the C language. If someone was using Ada95 and told me they had errors when they invoked the optimizer, I would be more suspicious of the compiler. In C, I'm almost always suspicious of the program. -- Dirk Grunwald Assoc. Prof, Univ. of Colorado at Boulder