From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28738 invoked by alias); 2 Sep 2011 08:37:52 -0000 Received: (qmail 28597 invoked by uid 22791); 2 Sep 2011 08:37:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 08:37:35 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1AD9FCB02B7; Fri, 2 Sep 2011 10:37:36 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ganccVDe+80F; Fri, 2 Sep 2011 10:37:25 +0200 (CEST) Received: from new-host.home (ADijon-552-1-48-137.w92-138.abo.wanadoo.fr [92.138.175.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 81349CB01E8; Fri, 2 Sep 2011 10:37:25 +0200 (CEST) From: Eric Botcazou To: Richard Guenther Subject: Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1 Date: Fri, 02 Sep 2011 08:37:00 -0000 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201109021038.36930.ebotcazou@adacore.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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/msg00107.txt.bz2 > Well, the comment for that folding is totally odd - of _course_ > unsigned sizetype things can overflow (we hid that issue merely > by pretending all unsigned sizetype constants (yes, only constants) > are signed. Huh.) It's again the special semantics of sizetypes whereby we pretend that they don't overflow. I know your opinion about this, but this is documented: /* In an INTEGER_TYPE, it means the type represents a size. We use this both for validity checking and to permit optimizations that are unsafe for other types. Note that the C `size_t' type should *not* have this flag set. The `size_t' type is simply a typedef for an ordinary integer type that happens to be the type of an expression returned by `sizeof'; `size_t' has no special properties. Expressions whose type have TYPE_IS_SIZETYPE set are always actual sizes. */ #define TYPE_IS_SIZETYPE(NODE) \ (INTEGER_TYPE_CHECK (NODE)->type_common.no_force_blk_flag) and we rely on these optimizations to simplify size computations in Ada. > 2011-08-31 Richard Guenther > > * fold-const.c (extract_muldiv_1): Remove bogus TYPE_IS_SIZETYPE > special-casing. IMO you shouldn't commit this kind of patchlets without the final big patch. -- Eric Botcazou