From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20357 invoked by alias); 21 Jun 2010 12:27:29 -0000 Received: (qmail 20099 invoked by uid 48); 21 Jun 2010 12:27:12 -0000 Date: Mon, 21 Jun 2010 12:27:00 -0000 Message-ID: <20100621122712.20098.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/44608] unspecified signed overflow applied to unsigned int In-Reply-To: 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/msg02030.txt.bz2 ------- Comment #7 from avr at gjlay dot de 2010-06-21 12:27 ------- (In reply to comment #5) > It is folding from the frontend that changes > > if (y >= 0x80000000) > > to > > if ((int) y < 0) > > (see code == LT instead of code == GEU) > > But the main issue is that y = -y to abs is bogus (but we can't easily tell > that as on RTL operands do not have a signedness). Both transformation are ok from the target's point of view. The bad thing is that undefinedness is propagated to RTL which is supposed to be an algebraic formulation of the target's instruction set. But in this case RTL is treated like a low level representation of C (or any other language gcc supports). To reproduce the problem it seems essential that there is an abssi2 insn in the md. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44608