As discussed in 
http://gcc.gnu.org/ml/gcc-help/2010-06/msg00191.html
I am filing a PR for the following piece of C:

int abssat2 (int x)
{
    unsigned int y = x;

    if (x < 0)
        y = -y;

    if (y >= 0x80000000)
        y--;

    return y;
}

Code looks fine until pass CE1 which introduces ABS rtx for the first
comparison (ifcvt.c:noce_try_abs). 

Pass insn combine then calls combine.c:combine_simplify_rtx() which calls
simplify_rtx.c:simplify_relational_operation (code=LT, mode=SImode,
cmp_mode=SImode, op0=(abs:SI (reg:SI)), op1=(const_int 0))
and the latter removes the second comparison against 0x80000000.

As this problem occurs on a non-standard target, let me know if I con you
provide with any additional information.


-- 
           Summary: unspecified signed overflow applied to unsigned int
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: avr at gjlay dot de
 GCC build triplet: pc-linux
  GCC host triplet: pc-linux
GCC target triplet: private


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44608

Reply via email to