Hacker News new | ask | show | jobs
by jmuhlich 4064 days ago
I think you might be looking at the wrong thing on the Wikipedia page. The core feature of Duff's Device is interleaved switch and do statements:

  n = (count + 7) / 8;
  switch (count % 8) {
  case 0: do { *to = *from++;
  case 7:      *to = *from++;
  case 6:      *to = *from++;
  case 5:      *to = *from++;
  case 4:      *to = *from++;
  case 3:      *to = *from++;
  case 2:      *to = *from++;
  case 1:      *to = *from++;
          } while (--n > 0);
  }
(extraneous register statements removed for conciseness)
1 comments

That would be a bug in the translation. We'll investigate. Thanks!
Yes indeed. We handled goto into do-while statements wrong. Fixed now. Thanks!