diff options
author | Thomas Koenig <Thomas.Koenig@online.de> | 2007-01-28 10:44:47 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2007-01-28 10:44:47 +0000 |
commit | 34462c28dffca29f115fb3bef4364eaff5a3ec43 (patch) | |
tree | cd42fe24f3db509640f6eaed63735f26f868c062 /gcc/fortran/arith.c | |
parent | eeef0e452e98fe6424ce65fb25fba15c59151848 (diff) | |
download | gcc-34462c28dffca29f115fb3bef4364eaff5a3ec43.zip gcc-34462c28dffca29f115fb3bef4364eaff5a3ec43.tar.gz gcc-34462c28dffca29f115fb3bef4364eaff5a3ec43.tar.bz2 |
re PR fortran/30389 ([4.1 only] ACHAR() intrinsic gives erroneous errors in constant-folding.)
2007-01-28 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30389
* gfortran.h: Remove gfc_simplify_init_1.
* arith.h: Remove third argument from gfc_compare_string.
* arith.c(gfc_compare_expression): Remove third argument
from call to gfc_compare_string.
(gfc_compare_string): Remove third argument xcoll_table.
Remove use of xcoll_table.
* misc.c(gfc_init_1): Remove call to gfc_simplify_init_1.
* simplify.c(ascii_table): Remove.
(xascii_table): Likewise.
(gfc_simplify_achar): ICE if extract_int fails. Remove use of
ascii_table. Warn if -Wsurprising and value < 0 or > 127.
(gfc_simplify_char): ICE if extract_int fails. Error if
value < 0 or value > 255.
(gfc_simplify_iachar): Remove use of xascii_table.
Char values outside of 0..255 are an ICE.
(gfc_simplify_lge): Remove use of xascii_table.
(gfc_simplify_lgt): Likewise.
(gfc_simplify_lle): Likewise.
(gfc_simplify_llt): Likewise.
(invert_table): Remove.
(gfc_simplify_init_1): Remove.
2007-01-28 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30389
* gfortran.dg/achar_2.f90: New test.
* gfortran.dg/achar_3.f90: New test.
From-SVN: r121255
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r-- | gcc/fortran/arith.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index f92de48..39bc4b9 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -1055,7 +1055,7 @@ gfc_compare_expr (gfc_expr *op1, gfc_expr *op2) break; case BT_CHARACTER: - rc = gfc_compare_string (op1, op2, NULL); + rc = gfc_compare_string (op1, op2); break; case BT_LOGICAL: @@ -1083,11 +1083,11 @@ compare_complex (gfc_expr *op1, gfc_expr *op2) /* Given two constant strings and the inverse collating sequence, compare the - strings. We return -1 for a < b, 0 for a == b and 1 for a > b. If the - xcoll_table is NULL, we use the processor's default collating sequence. */ + strings. We return -1 for a < b, 0 for a == b and 1 for a > b. + We use the processor's default collating sequence. */ int -gfc_compare_string (gfc_expr *a, gfc_expr *b, const int *xcoll_table) +gfc_compare_string (gfc_expr *a, gfc_expr *b) { int len, alen, blen, i, ac, bc; @@ -1103,12 +1103,6 @@ gfc_compare_string (gfc_expr *a, gfc_expr *b, const int *xcoll_table) ac = (unsigned char) ((i < alen) ? a->value.character.string[i] : ' '); bc = (unsigned char) ((i < blen) ? b->value.character.string[i] : ' '); - if (xcoll_table != NULL) - { - ac = xcoll_table[ac]; - bc = xcoll_table[bc]; - } - if (ac < bc) return -1; if (ac > bc) |