From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2339 invoked by alias); 3 Sep 2011 19:47:55 -0000 Received: (qmail 2331 invoked by uid 22791); 3 Sep 2011 19:47:55 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from VLSI1.ULTRA.NYU.EDU (HELO vlsi1.ultra.nyu.edu) (128.122.140.213) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 03 Sep 2011 19:47:41 +0000 Received: by vlsi1.ultra.nyu.edu (4.1/1.34) id AA28670; Sat, 3 Sep 11 15:47:37 EDT From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner) Message-Id: <11109031947.AA28670@vlsi1.ultra.nyu.edu> Date: Sat, 03 Sep 2011 19:47:00 -0000 To: richard.guenther@gmail.com Subject: Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1 Cc: ebotcazou@adacore.com, gcc-patches@gcc.gnu.org, rguenther@suse.de In-Reply-To: References: <201109031124.37807.ebotcazou@adacore.com> <201109031708.52403.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00228.txt.bz2 Let me jump in on this a little bit, since much of the code in this area was originally written by me. > Are all sizetype (sub-)expressions always of value in that range? > What do we do about the fact that sizetype is unsigned, so -x always > overflows for x != 0? Thus, do we need to disable all a - b -> a + > -b kind of foldings for sizetypes? (we don't) The basic idea is that an overflow of sizetype is either: (1) Detected at a higher level (e.g., testing for maximum sizes of objects) or; (2) Is an undetected error and hence the result of such overflow is undefined. What this means from a practical point of view (but indeed a bit hard to define from a formal point of view) is that the normal addition and subtraction operations (on a 2's complement machines, which all are now) will "do the right thing" in all cases so we can perform all those sorts of folding operations.