diff options
author | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-07 16:48:18 +0000 |
---|---|---|
committer | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-07 16:48:18 +0000 |
commit | 598b108ab505cab08f19246cc31243e0a73c1082 (patch) | |
tree | 4f1d503f946ad196afc135214a5ab73b0196136d /gcc/fortran/arith.c | |
parent | eb00282b65f09ea3496edca2ba1ed36f1a7202ff (diff) | |
download | gcc-598b108ab505cab08f19246cc31243e0a73c1082.tar.gz |
2006-09-07 Steven G. Kargl <kargls@comcast.net>
* gfortran.fortran-torture/compile/data_1.f90: Fix integer oveflow
in integer literal constant.
* gfortran.dg/enum_8.f90: Ditto.
* gfortran.dg/g77/20030326-1.f: Ditto.
2006-09-07 Steven G. Kargl <kargls@comcast.net>
* gfortran.h (gfc_integer_info): Eliminate max_int.
* arith.c (gfc_arith_init_1): Remove initialization of max_int.
(gfc_arith_done_1): Remove clearing of max_int.
(gfc_check_integer_range): Fix range chekcing of overflow.
* simplify.c (gfc_simplify_not): Construct mask that was max_int.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116753 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r-- | gcc/fortran/arith.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 884d810c99b..766169fa6e1 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -195,7 +195,7 @@ gfc_arith_init_1 (void) /* These are the numbers that are actually representable by the target. For bases other than two, this needs to be changed. */ if (int_info->radix != 2) - gfc_internal_error ("Fix min_int, max_int calculation"); + gfc_internal_error ("Fix min_int calculation"); /* See PRs 13490 and 17912, related to integer ranges. The pedantic_min_int exists for range checking when a program @@ -210,10 +210,6 @@ gfc_arith_init_1 (void) mpz_init (int_info->min_int); mpz_sub_ui (int_info->min_int, int_info->pedantic_min_int, 1); - mpz_init (int_info->max_int); - mpz_add (int_info->max_int, int_info->huge, int_info->huge); - mpz_add_ui (int_info->max_int, int_info->max_int, 1); - /* Range */ mpfr_set_z (a, int_info->huge, GFC_RND_MODE); mpfr_log10 (a, a, GFC_RND_MODE); @@ -321,7 +317,6 @@ gfc_arith_done_1 (void) for (ip = gfc_integer_kinds; ip->kind; ip++) { mpz_clear (ip->min_int); - mpz_clear (ip->max_int); mpz_clear (ip->pedantic_min_int); mpz_clear (ip->huge); } @@ -356,7 +351,7 @@ gfc_check_integer_range (mpz_t p, int kind) } if (mpz_cmp (p, gfc_integer_kinds[i].min_int) < 0 - || mpz_cmp (p, gfc_integer_kinds[i].max_int) > 0) + || mpz_cmp (p, gfc_integer_kinds[i].huge) > 0) result = ARITH_OVERFLOW; return result; |