This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: i370 port
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.