Xref: utzoo comp.lang.modula2:1195 comp.lang.misc:2524 comp.lang.pascal:1403 Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!ukma!gatech!gitpyr!loligo!mccalpin From: mccalpin@loligo.cc.fsu.edu (John McCalpin) Newsgroups: comp.lang.modula2,comp.lang.misc,comp.lang.pascal Subject: Re: conditional compilation (was C++ vs Modula-2) Summary: optimization != conditional compilation Keywords: conditional compilation, optimization Message-ID: <427@loligo.cc.fsu.edu> Date: 13 Jan 89 14:21:51 GMT References: Reply-To: mccalpin@loligo.UUCP (John McCalpin) Organization: Supercomputer Computations Research Institute Lines: 31 In article writes: >As was recently observed in the info-pascal mailing list, optimization -> >conditional compilation. Consider: > CONST > OpSys = VMS; > IF OpSys = VMS THEN > DoVMSStuff > ELSE > DoOtherOSStuff; >All but the most inanely STUPID of compilers will completely eliminate the >unreachable code. Anthony L Kimball : alk @ ux.acss.umn.edu / UMNACVX.bitnet This is only true if the code in Do_VMS_Stuff is *syntactically valid* on all machines. Certainly not all machine-specific extensions are compilable on all systems -- I am thinking of VMS in particular here. In the Fortran context, there ain't no way to make most machines compile statements like call LIB$SYS_VMS_SPECIFIC_STUFF (args) and the optimizers I know of won't remove the dead code unless they can figure out what it is, since optimization comes long after parsing and lexical analysis.... In the modula-2 context, I am sure that the machine-specific vector extensions to the CDC Pascal/Modula-2 compiler (for the Cyber 205 & ETA-10) are not syntactically valid on other machines.... -- ---------------------- John D. McCalpin ------------------------ Dept of Oceanography & Supercomputer Computations Research Institute mccalpin@masig1.ocean.fsu.edu mccalpin@nu.cs.fsu.edu ------------------------------------------------------------------