diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-17 00:54:25 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-17 00:54:25 +0000 |
commit | 58f9db871e93ba5851e7d1ba820533c86518b2ab (patch) | |
tree | 3c8bb9a066d5c956f9d8bb26a8f15c3f4286bd4b /gcc/fold-const.c | |
parent | a449215f3d0a567d6566f633ca3925e1ab954401 (diff) | |
download | ppe42-gcc-58f9db871e93ba5851e7d1ba820533c86518b2ab.tar.gz ppe42-gcc-58f9db871e93ba5851e7d1ba820533c86518b2ab.zip |
* Makefile.in ($(srcdir)/c-parse.y: c-parse.in): Enclose the whole
message in quotes. Otherwise, IBM's make program treats the '#' as the
start of a comment and ignores the remainder of the line.
* c-lex.c (yylex): Change for EBCDIC, lower case characters preceed
upper case.
* cccp.c (initialize_char_syntax): Allow for holes in EBCDIC.
* cexp.y (initialize_random_junk): Likewise.
* cppfiles.c (find_include_file): Cast alloca return value.
* cppinit.c (initialize_standard_includes): Likewise.
* cpplib.c (cpp_define, cpp_undef): Likewise.
* defaults.h (ASM_OUTPUT_ASCII): Use ISPRINT.
* final.c (output_asm_insn): Allow for holes in EBCDIC.
* fold-const.c (CHARMASK): New.
(real_hex_to_f): Use it.
* real.c (CHARMASK): New.
(etoasc, asctoeg): Use it.
(asctoeg): EBCDIC lower case characters preceed upper case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33192 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 991dddda973..e0d0f00cb4e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -106,6 +106,14 @@ static int count_cond PARAMS ((tree, int)); #define BRANCH_COST 1 #endif +#if defined(HOST_EBCDIC) +/* bit 8 is significant in EBCDIC */ +#define CHARMASK 0xff +#else +#define CHARMASK 0x7f +#endif + + /* We know that A1 + B1 = SUM1, using 2's complement arithmetic and ignoring overflow. Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1. Then this yields nonzero if overflow occurred during the @@ -1091,8 +1099,8 @@ real_hex_to_f (s, mode) if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) { - k = c & 0x7f; - if (k >= 'a') + k = c & CHARMASK; + if (k >= 'a' && k <= 'f') k = k - 'a' + 10; else if (k >= 'A') k = k - 'A' + 10; @@ -1137,7 +1145,7 @@ real_hex_to_f (s, mode) The exponent field is a decimal integer. */ while (ISDIGIT(*p)) { - k = (*p++ & 0x7f) - '0'; + k = (*p++ & CHARMASK) - '0'; expon = 10 * expon + k; } |