From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24215 invoked by alias); 10 Nov 2009 15:51:03 -0000 Received: (qmail 24201 invoked by uid 22791); 10 Nov 2009 15:51:01 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f196.google.com (HELO mail-px0-f196.google.com) (209.85.216.196) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Nov 2009 15:50:57 +0000 Received: by pxi34 with SMTP id 34so90622pxi.8 for ; Tue, 10 Nov 2009 07:50:55 -0800 (PST) Received: by 10.115.66.35 with SMTP id t35mr443248wak.87.1257868255411; Tue, 10 Nov 2009 07:50:55 -0800 (PST) Received: from Paullaptop (203-158-49-56.dyn.iinet.net.au [203.158.49.56]) by mx.google.com with ESMTPS id 21sm494550pxi.0.2009.11.10.07.50.52 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 07:50:53 -0800 (PST) Message-ID: From: "Paul Edwards" To: "Ian Lance Taylor" Cc: "Ulrich Weigand" , References: <200911041646.nA4Gkx1m032222@d12av02.megacenter.de.ibm.com><49D99EB7E50944F4A09820F1016ACA77@Paullaptop> In-Reply-To: Subject: Re: i370 port Date: Tue, 10 Nov 2009 15:51:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00281.txt.bz2 There are a couple of places where I need to do something different if I'm running on an EBCDIC host (e.g. MVS, CMS, MUSIC, VSE). So in mvspdp.h I have put: /* If running on MVS, need some EBCDIC-related differences */ #if defined(__MVS__) || defined(__CMS__) #define HOST_EBCDIC 1 #endif and c-parse.c: #ifdef HOST_EBCDIC #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? \ ((unsigned int) (YYX) < 256 ? yytranslate[_sch_ebcasc[YYX]] \ : yytranslate[YYX]) : YYUNDEFTOK) #else #define YYTRANSLATE(YYX) ^I^I^I^I^I^I\ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) #endif and opts.c: #ifdef HOST_EBCDIC static size_t find_opt (const char *input, int lang_mask) { /* sequential search */ Is that a reasonable way to do it? I think I should probably make the opts.c into a PUREISO so that the sequential search is always used (ie work on an arbitrary C90 platform, not necessarily ASCII or EBCDIC). But the c-parse one is definitely a translation that will only work on EBCDIC. That is useful so that I don't need to have a working bison. Similarly, the opts.c change doesn't require a working shell! > I think I would stop right there. Why can't the i370 port support > 64-bit integers? Plenty of 32-bit hosts support them. It got an internal error. I don't have the skills to get that to work, but I do have the skills to bypass it one way or another (and I demonstrated what I am doing now, but I know that that intrusive code will break everything else, so want to back it out, without losing the functionality that I want). > That said, these days gcc always defines __SIZEOF_LONG_LONG__. It > would be perfectly reasonable for hwint.h to test that. Maybe > something along the lines of > > #if !defined HAVE_LONG_LONG > # if GCC_VERSION >= 3000 > # ifdef __SIZEOF_LONG_LONG__ > # define HAVE_LONG_LONG 1 > # define SIZEOF_LONGLONG __SIZEOF_LONG_LONG__ > # else > # define HAVE_LONG_LONG 1 > # define SIZEOF_LONG_LONG 8 These both switch long_long on. I want to switch it off (which it was already). > extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1]; > # endif > # endif > #endif So would defining a new option be a reasonable solution for any target that wants to limit code generation for whatever reason? Thanks. Paul.