Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!rpi!uwm.edu!lll-winken!sun-barr!newstop!sun!amdcad!nucleus!tim From: tim@nucleus.amd.com (Tim Olson) Newsgroups: comp.lang.c Subject: Re: is this broken or what? Message-ID: <28900@amdcad.AMD.COM> Date: 24 Jan 90 03:30:15 GMT References: <1482@mdbs.UUCP> <1990Jan23.155910.2439@cubmol.bio.columbia.edu> Sender: news@amdcad.AMD.COM Reply-To: tim@amd.com (Tim Olson) Organization: Advanced Micro Devices, Inc., Austin, Texas Lines: 28 Summary: Expires: Sender: Followup-To: In article <1990Jan23.155910.2439@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes: | In article <1482@mdbs.UUCP> wsmith@mdbs.UUCP (Bill Smith) writes: | > unsigned u = 0; | > | > if (u-- < 4) | > printf("yes\n"); | > else | > printf("no\n"); | > | >The Data General Aviion 5000 (an 88000 machine) version of GCC converts this | >into: | > | > unsigned u = 0; | > | > if(--u < 3) .... | > | >for the assembly. | > | | To me, the codes in the two cases are same. Check out what happens when u == 0. Yes, it is an unsafe optimization which should not be performed. -- Tim Olson Advanced Micro Devices (tim@amd.com)