Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Epic Fail Date: Wed, 23 Apr 2014 20:16:03 -0400 Organization: Aioe.org NNTP Server Lines: 30 Message-ID: References: <64idnem648RzN9jOnZ2dnUVZ8iWdnZ2d@supernews.com> <2014Apr11.192347@mips.complang.tuwien.ac.at> <2014Apr13.181030@mips.complang.tuwien.ac.at> <27ilk9dvau3o08tmi9ccedohs8j8oujac2@4ax.com> <2014Apr23.150747@mips.complang.tuwien.ac.at> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:29800 On Wed, 23 Apr 2014 09:07:47 -0400, Anton Ertl wrote: [volatile issues in Forth] > In any case, if the programmer wants to write "foo @ dup", they can do > so, so there is little reason to "optimize" "foo @ foo @" into "foo @ > dup", and if there are any reasons not to do it, we should refrain > from it. How do you tell a Forth optimizer to selectively not optimize "foo @ foo @" into "foo @ dup"? Forth has no keyword like "volatile" in C to say: "Do not optimize this code." Conclusively, you must either: 1) disable all pointer based optimizations to prevent compiler optimization errors. (Didn't you just have a large rant on erroneous optimizations in C? ...) or, 2) implement a minimal type system in the optimizer so that when it recognizes "dup" in "foo @ dup" it can determine that the stack value is a pointer and do the opposite of optimizing, by converting "dup" into "foo @". Yes? Rod Pemberton