public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/44608]  New: unspecified signed overflow applied to unsigned int
@ 2010-06-21 11:24 avr at gjlay dot de
  2010-06-21 11:27 ` [Bug middle-end/44608] " avr at gjlay dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: avr at gjlay dot de @ 2010-06-21 11:24 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-21 22:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21 11:24 [Bug middle-end/44608] New: unspecified signed overflow applied to unsigned int avr at gjlay dot de
2010-06-21 11:27 ` [Bug middle-end/44608] " avr at gjlay dot de
2010-06-21 11:28 ` avr at gjlay dot de
2010-06-21 11:29 ` avr at gjlay dot de
2010-06-21 11:30 ` avr at gjlay dot de
2010-06-21 11:38 ` rguenth at gcc dot gnu dot org
2010-06-21 11:51 ` rguenth at gcc dot gnu dot org
2010-06-21 12:27 ` avr at gjlay dot de
2010-07-21 22:51 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).