[Bug c/46711] __builtin_choose_expr checks not chosen expression
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 29 20:07:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46711
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-11-29 19:40:04 UTC ---
Try:
static inline unsigned long *
_param(struct pt_regs *regs, const int num) __attribute__((always_inline));
static inline unsigned long *
_param(struct pt_regs *regs, const int num)
{
switch (num) {
case 0: return &PARAM0(regs);
case 1: return &PARAM1(regs);
case 2: return &PARAM2(regs);
case 3: return &PARAM3(regs);
case 4: return &PARAM4(regs);
case 5: return &PARAM5(regs);
}
/* should not happen */
return NULL;
}
#define PARM(regs, num) *_param(regs, num)
This will provide something which is always optimized even at -O0.
More information about the Gcc-bugs
mailing list