From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26964 invoked by alias); 21 Jun 2010 11:24:07 -0000 Received: (qmail 26857 invoked by uid 48); 21 Jun 2010 11:23:50 -0000 Date: Mon, 21 Jun 2010 11:24:00 -0000 Subject: [Bug middle-end/44608] New: unspecified signed overflow applied to unsigned int X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "avr at gjlay dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg02017.txt.bz2 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