optimization hints?

Alfred Perlstein bright@rush.net
Fri Jun 11 01:47:00 GMT 1999


It has always seemed weird that C, the langue usually chosen because
it's closeness to the machine level wouldn't have a hint like 
system for doing branches.

Is there such a way to do this?

case in point:


  do {
    if ((ret = poll(pfds, num_pfds, INFTIM)) == -1)
        switch(ret = errno) {
        case EINTR:
             continue;
        default:
             panic("internal poll error %s", strerror(ret));
        }
    }
  ......
  } while (...);

just the fact that I don't expect an error (poll() returning -1),
I was hoping to be able to tell it that this code isn't likely to
execute and perhaps even move it someplace else to maximize the
instruction cache utilization of my code.

does this make sense?  is there anything in the works to do this, or
perhaps something I missed?

isn't it about time C developers had this kind of control over thier
code?

it'd be nice to have a "maybe((ret = poll(pfds, num_pfds, INFTIM)) == -1)"
or something :)

thanks,
-Alfred 



More information about the Gcc mailing list