Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!emory!wuarchive!psuvax1!hsdndev!cmcl2!lanl!cochiti.lanl.gov!jlg From: jlg@cochiti.lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: <18401@lanl.gov> Date: 19 Mar 91 21:12:13 GMT References: <8148@rsiatl.Dixie.Com> <15481@smoke.brl.mil> <775@camco.Celestial.COM> <65837@eerie.acsu.Buffalo.EDU> <1991Mar18.195351.11985@unlv.edu> <11109@dog.ee.lbl.gov> Sender: news@lanl.gov Reply-To: jlg@cochiti.lanl.gov (Jim Giles) Organization: Los Alamos National Laboratory Lines: 21 In article <11109@dog.ee.lbl.gov>, torek@elf.ee.lbl.gov (Chris Torek) writes: |> [...] |> Smaller source code, yes. Smaller or faster object code---well, if |> your compiler generates different code for |> |> if (a = b) |> |> than for |> |> a = b; |> if (a) |> |> then your compiler is not worth what you paid for it. [...] Even if it was _free_! The above 'optimization' was present in Fortran compilers more than 30 years ago - and their _fastest_ machines were slow compared to today's micros (so the excuse that doing the above analysis makes the compiler too slow or complex is garbage). J. Giles