Commit c5144966 by Harald Anlauf Committed by Harald Anlauf

re PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at…

re PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran/simplify.c:173)

2019-11-25  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/92629
	* simplify.c (convert_mpz_to_unsigned): Skip assert for argument
	range when -fno-range-check is specified.

	PR fortran/92629
	* gfortran.dg/pr92629.f90: New testcase.

From-SVN: r278699
parent 7def9bd7
2019-11-25 Harald Anlauf <anlauf@gmx.de>
PR fortran/92629
* simplify.c (convert_mpz_to_unsigned): Skip assert for argument
range when -fno-range-check is specified.
2019-11-25 Mark Eggleston <mark.eggleston@codethink.com>
Jim MacArthur <jim.macarthur@codethink.co.uk>
......
......@@ -169,8 +169,10 @@ convert_mpz_to_unsigned (mpz_t x, int bitsize)
}
else
{
/* Confirm that no bits above the signed range are set. */
gcc_assert (mpz_scan1 (x, bitsize-1) == ULONG_MAX);
/* Confirm that no bits above the signed range are set if we
are doing range checking. */
if (flag_range_check != 0)
gcc_assert (mpz_scan1 (x, bitsize-1) == ULONG_MAX);
}
}
......
2019-11-25 Harald Anlauf <anlauf@gmx.de>
PR fortran/92629
* gfortran.dg/pr92629.f90: New testcase.
2019-11-25 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/diagnostic/base-operand-non-pointer-1.C: New.
......
! { dg-do run }
! { dg-options "-fno-range-check" }
!
! Test the fix for PR92629.
program bge_tests
if (bge (huge (1_1), 128_1)) stop 1
if (bge ( 128_1 , 255_1)) stop 2
if (bge (huge (1_2), 32768_2)) stop 3
if (bge (huge (1_4), 2147483648_4)) stop 4
if (bge (huge (1_8), 9223372036854775808_8)) stop 5
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment