Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!sri-unix!garth!walter From: walter@garth.UUCP (Walter Bays) Newsgroups: comp.lang.c Subject: Re: volatile Message-ID: <595@garth.UUCP> Date: 10 Apr 88 00:44:20 GMT References: <12578@brl-adm.ARPA> <1988Mar25.172355.348@utzoo.uucp> <18686@think.UUCP> <4217@ihlpf.ATT.COM> <10914@mimsy.UUCP> <150@ghostwheel.UUCP> <4346@ihlpf.ATT.COM> Reply-To: walter@garth.UUCP (Walter Bays) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 23 In article <4346@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704a-Liber,N.J.) writes: >No, what this means is that in the future, when we have highly optimizing >compilers and highly efficient hardware (such as caches,etc.), that this code >may break. In order to do certain types of optimizations, certain assumptions >have to be made. For example, if I know that a certain variable has no >aliases, then in the implementation I can keep it's value in a cache (which >is faster) without having to update the actual memory location it is >suppose to be stored at. As things stand now, these assumptions are made >on a compiler-by-compiler basis. I agree. Worse, in many cases the future is now. Usually the compiler must forgo optimizations that would work for nearly all programs for fear of breaking a few. And remember, optimization is more important for RISC than for CISC. C wizards will use 'volatile' and 'noalias'. Ordinary users may totally ignore them, and will still get the benefit of faster applications running on faster kernels. -- ------------------------------------------------------------------------------ Any similarities between my opinions and those of the person who signs my paychecks is purely coincidental. E-Mail route: ...!pyramid!garth!walter USPS: Intergraph APD, 2400 Geng Road, Palo Alto, California 94303 Phone: (415) 852-2384 ------------------------------------------------------------------------------