Related articles |
---|
Does Duff Device break C compilers Lambert.Lum@eng.efi.com (Lambert Lum) (1996-05-06) |
Re: Does Duff Device break C compilers preston@tera.com (1996-05-07) |
Re: Does Duff Device break C compilers krste@ICSI.Berkeley.EDU (1996-05-08) |
Re: Does Duff Device break C compilers jeremy@floyd.sw.oz.au (1996-05-10) |
Re: Does Duff Device break C compilers rankin@eql.caltech.edu (1996-05-10) |
Re: Does Duff Device break C compilers msb@sq.com (1996-05-10) |
Re: Does Duff Device break C compilers preston@tera.com (1996-05-13) |
Re: Does Duff Device break C compilers baynes@ukpsshp1.serigate.philips.nl (1996-05-19) |
From: | baynes@ukpsshp1.serigate.philips.nl |
Newsgroups: | comp.compilers |
Date: | 19 May 1996 14:28:18 -0400 |
Organization: | Compilers Central |
References: | 96-05-050 96-05-054 |
Keywords: | C, optimize |
Preston Briggs (preston@tera.com) wrote:
: >item called Duff's Device. I showed to a couple of guys here at my
: >work place and they never seen it before. Then they declared that such
: >an unorthodox technique could potential break some C compilers.
: I agree with the moderator. It's not obvious, but it's not that hard
: to compile. I'd expect everyone to get it right. On the other hand,
: I wouldn't be surprised if the resulting code wasn't that great. Why?
: It makes an irreducible loop and lots of optimizers don't do much with
: irreducible loops. Also hard to software pipeline, etc.
Certainly the compiler I worked on recognized 'conventionally written'
switch statements and converted them to a structured statement that was
properly optimized. The Duffs device code would not be handled this way, it
would be routed to the 'I don't know whats happening here, I had better play
safe and turn of all optimizations' code generator.
--
Stephen Baynes baynes@ukpsshp1.serigate.philips.nl
Philips Semiconductors Ltd
Southampton
United Kingdom
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.