This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
A question about MAX_EXPR
- From: Revital1 Eres <ERES at il dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 23 Aug 2010 14:46:21 +0300
- Subject: 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);
}