On 11/05/13 15:00, Cong Hou wrote:
Can you factor those two hunks of nearly identical code into a single
function and call it twice? I'm also curious if you really need the code to
swap lhs/rhs. When can the LHS of a cond be an integer constant? Don't we
canonicalize it as ?
I was not aw
On Tue, Nov 5, 2013 at 12:23 PM, Jeff Law wrote:
> On 10/31/13 18:03, Cong Hou wrote:
>>
>> (This patch is for the bug 58728:
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728)
>>
>> As in the bug report, consider the following loop:
>>
>> int foo(unsigned int n)
>> {
>>if (n != 0)
>>if
It seems there are some changes in GCC. But if you change the type of
n into signed int, the issue appears again:
int foo(int n)
{
if (n != 0)
if (n != 1)
if (n != 2)
if (n != 3)
if (n != 4)
return ++n;
return n;
}
Also, ifcombine also suffers from the same issue here.
t
On Tue, Nov 05, 2013 at 01:23:00PM -0700, Jeff Law wrote:
> On 10/31/13 18:03, Cong Hou wrote:
> >(This patch is for the bug 58728:
> >http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728)
> >
> >As in the bug report, consider the following loop:
> >
> >int foo(unsigned int n)
> >{
> > if (n != 0)
>
On 10/31/13 18:03, Cong Hou wrote:
(This patch is for the bug 58728:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728)
As in the bug report, consider the following loop:
int foo(unsigned int n)
{
if (n != 0)
if (n != 1)
if (n != 2)
if (n != 3)
if (n != 4)
return ++n;
ret
(This patch is for the bug 58728:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728)
As in the bug report, consider the following loop:
int foo(unsigned int n)
{
if (n != 0)
if (n != 1)
if (n != 2)
if (n != 3)
if (n != 4)
return ++n;
return n;
}
The range test optimization should