|while loop code generation email@example.com (1997-12-14)|
|Re: while loop code generation firstname.lastname@example.org (1997-12-15)|
|Re: while loop code generation email@example.com (Craig Burley) (1997-12-15)|
|Re: while loop code generation firstname.lastname@example.org (Tom Lane) (1997-12-15)|
|Re: while loop code generation email@example.com (1997-12-15)|
|Re: while loop code generation tim@franck.Princeton.EDU.composers (1997-12-29)|
|Re: while loop code generation firstname.lastname@example.org (1998-01-03)|
|From:||email@example.com (Andrew Tucker)|
|Date:||14 Dec 1997 22:36:44 -0500|
|Organization:||Northwest Nexus, Inc.|
On page 227 of Fraser and Hanson's _A Retargetable C Compiler_,
they claim that the code
L+1: if expression != 0 goto L
generates n+2 goto's for a loop executing statement n times while
L+1: if expression == 0 goto L+2
generates 2n+1 goto's.
Maybe my analysis (and my test code) are severely flawed, but
I see both layouts as equivalent, with n+1 gotos executed when
statement is executed n times.
Am I missing something or is their claim incorrect?
/* Andrew */
Return to the
Search the comp.compilers archives again.