Am 12.04.2014 21:33, schrieb Thomas Koenig:
please find attached a patch for PR 59604.
The patch makes sure that, if -fno-range-check is specified,
using int on an overflowing boz constant yields the same
result for compile-time simplification and run-time
execution.
OK for trunk?
Looks good to me. At a glance, it looks as if it also fixes the original
bug 58003 - or is something still missing?
Tobias
2014-03-12 Thomas Koenig <tkoe...@gcc.gnu.org>
PR fortran/59604
* gfortran.h (gfc_convert_mpz_to_signed): Add prototype.
* arith.c (gfc_int2int): Convert number to signed if
arithmetic overflow is not checked.
* simplify.c (convert_mpz_to_unsigned): Only trigger assert for
size if range checking is in force.
(convert_mpz_to_signed): Make non-static, rename to
(gfc_convert_mpz_to_signed).
(simplify_dshift): Use gfc_convert_mpz_to_signed.
(gfc_simplify_ibclr): Likewise.
(gfc_simplify_ibits): Likewise.
(gfc_simplify_ibset): Likewise.
(simplify_shift): Likewise.
(gfc_simplify_ishiftc): Likewise.
(gfc_simplify_maskr): Likewise.
(gfc_simplify_maskl): Likewise.
2014-03-12 Thomas Koenig <tkoe...@gcc.gnu.org>
PR fortran/59604
* gfortran.dg/no_range_check_3.f90: New test.