This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A question about MAX_EXPR


Hello,

I'm compiling the following test with GCC 4.6.0 and I do not see that
MAX_EXPR is generated for (num)<0)?0:(num).
With GCC 4.3.2 it is generated OK in original dump (both compilation were
made with -O3).  Is there a flag I should use to generate MAX_EXPR
with GCC 4.6.0?

Thanks,
Revital

#define TEST(num) (unsigned char)(((num)>0xFF)?0xff:(((num)<0)?0:(num)))

int foo(const unsigned char *tmp, int i, int val)
{
    return TEST(tmp[i] + val);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]