From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [Patch]: Fix ICE on VMS when using SImode pointers Date: Wed, 04 Apr 2012 08:13:00 -0000 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00164.txt.bz2 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)) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ | 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(sizetyp= e) > 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 wil= l never trigger. Ok for trunk ? Tristan. 2012-04-04 Tristan Gingold * expr.c (expand_expr_real_2): Handle larger sizetype in POINTER_PLUS_EXPR. --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7957,6 +7957,9 @@ expand_expr_real_2 (sepops ops, rtx target, enum mach= ine_m treeop1 =3D fold_convert_loc (loc, type, fold_convert_loc (loc, ssizetype, treeop1)); + else if (TYPE_PRECISION (sizetype) > TYPE_PRECISION (type)) + treeop1 =3D 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 u