From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alfred Perlstein To: egcs@egcs.cygnus.com Subject: optimization hints? Date: Wed, 30 Jun 1999 15:43:00 -0000 Message-ID: X-SW-Source: 1999-06n/msg00374.html Message-ID: <19990630154300.Gyjx1qXezqDUlotGF5E5Ct4QQjs0D5DOV5p8CMWIX94@z> 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