From patchwork Wed Apr 4 08:13:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 150634 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 061ADB6FF2 for ; Wed, 4 Apr 2012 18:14:05 +1000 (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=1334132046; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:Cc:To:Mime-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=GPHA/CF645jbXtt7qreHTjTSQtc=; b=grfO8BjgnfcUtt5 a7hIYMn4mRXyHyMl20Ll8w6S8g0/QuqREytagineGYhf+EVM/gKogFG69E8GfTHi IXSbXdaYOx703zO2Q37BkQ09i0G1oa6lNytgMioMJyd6633Y1mvo1zTArNmvEju2 2axoOS5bFbzLIWvAzX+kAAhRbzdA= 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:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:Cc:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jkHTAv8qj2NQM2WSIFEo//FyfrgZ82KvzIb4RJCS2/ohuSiyN7ZrrXZddozxOB Bn9N7+w30LL6OSu3Ay2vogTpQZd13jmC3NPu/I5KRz4wrV4CPlvvbJU6UnV/gnzG FP7vmMVvLmEuxmh89hMF9l4PRyfm8TiWPwDTsRIrjcKXs=; Received: (qmail 25704 invoked by alias); 4 Apr 2012 08:13:55 -0000 Received: (qmail 25693 invoked by uid 22791); 4 Apr 2012 08:13:51 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, MIME_QP_LONG_LINE 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; Wed, 04 Apr 2012 08:13:38 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 7311A290038; Wed, 4 Apr 2012 10:13:42 +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 W6EUhkgJXlkL; Wed, 4 Apr 2012 10:13:42 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5981529000A; Wed, 4 Apr 2012 10:13:42 +0200 (CEST) From: Tristan Gingold Subject: [Patch]: Fix ICE on VMS when using SImode pointers Date: Wed, 4 Apr 2012 10:13:37 +0200 Message-Id: Cc: Richard Guenther To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1257) X-IsSubscribed: yes 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 Hi, this patch fixes a build time failure on VMS (while compiling Ada RTS file i-cstrin.adb) due to the use of short pointers: i-cstrin.adb: In function 'Interfaces.C.Strings.To_Chars_Ptr': i-cstrin.adb:236:8: error: unrecognizable insn: (insn 80 79 81 13 (set (reg:SI 384) (const_int 4294967288 [0xfffffff8])) i-cstrin.adb:234 -1 (nil)) +===========================GNAT BUG DETECTED==============================+ | Pro 7.1.0w (20120403-47) (ia64-hp-openvms) GCC error: | | in extract_insn, at recog.c:2123 | | Error detected around i-cstrin.adb:236:8 | Expansion of POINTER_PLUS_EXPR doesn't handle the case of PRECISION(sizetype) > PRECISION(type), leading to RTL expressions with different modes. This patch fixes the build issue, tested on ia64-hp-openvms. Also tested with our internal testsuite. I haven't run the GCC testsuite on a regular platform, as the condition will never trigger. Ok for trunk ? Tristan. 2012-04-04 Tristan Gingold * expr.c (expand_expr_real_2): Handle larger sizetype in POINTER_PLUS_EXPR. u --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7957,6 +7957,9 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_m treeop1 = fold_convert_loc (loc, type, fold_convert_loc (loc, ssizetype, treeop1)); + else if (TYPE_PRECISION (sizetype) > TYPE_PRECISION (type)) + treeop1 = fold_convert_loc (loc, type, treeop1); + case PLUS_EXPR: /* If we are adding a constant, a VAR_DECL that is sp, fp, or ap, and something else, make sure we add the register to the constant and