From patchwork Wed Mar 7 12:57:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 145254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3D0A7B6EEE for ; Wed, 7 Mar 2012 23:57:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331729856; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=gGUWYBr BcbfPOvlSIwhakD4LGjA=; b=XJimDzKj4d0AE1pzZRxPhdLAWXtyiqJGMKDqxkn vSFLQ4Ot9cy63psRt7Tb4hbIcWLOvlpdNTN45fU7s2PABHWuOZW6EeEkl12OaZJw q/BLgMc2q7mYOWFojgbVEN637oMF5KAN7kRCmCfqsiZJwqEE3SzqumERShBUxP0q gq+0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=yBTNGtBngQVdjeOwaESmXJpUMYWbHoxNk4xjtpwhyheYacTf/3tK9KiB8l2XT4 nQoJIVE7spuOrgjAwGLZ7Z2dHH8kc00ujjxPx+aKGHrOjHuKypmlQUxaizRY95ox O47rgidkpfzaHh57LKPkso8o4KzrqpdE3OanEkeuX0LAk=; Received: (qmail 4582 invoked by alias); 7 Mar 2012 12:57:32 -0000 Received: (qmail 4566 invoked by uid 22791); 7 Mar 2012 12:57:31 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Mar 2012 12:57:15 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id E31148FC93; Wed, 7 Mar 2012 13:57:14 +0100 (CET) Date: Wed, 7 Mar 2012 13:57:14 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: "Joseph S. Myers" Subject: [PATCH] Use c_common_type_for_size from the C frontend Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I'll apply this as obvious after including it in a bootstrap / regtest. Richard. 2012-03-07 Richard Guenther * c-typeck.c (pointer_diff): Use c_common_type_for_size. Index: gcc/c-typeck.c =================================================================== --- gcc/c-typeck.c (revision 185029) +++ gcc/c-typeck.c (working copy) @@ -3413,8 +3410,7 @@ pointer_diff (location_t loc, tree op0, be the same as the result type (ptrdiff_t), but may need to be a wider type if pointers for the address space are wider than ptrdiff_t. */ if (TYPE_PRECISION (restype) < TYPE_PRECISION (TREE_TYPE (op0))) - inttype = lang_hooks.types.type_for_size - (TYPE_PRECISION (TREE_TYPE (op0)), 0); + inttype = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op0)), 0); else inttype = restype;