Fix ICE in tree-chkp-opt.c (PR tree-optimization/79631).

2017-03-09  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79631
	* tree-chkp-opt.c (chkp_is_constant_addr): Call
	tree_int_cst_sign_bit just for INTEGER constants.
2017-03-09  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79631
	* gcc.target/i386/mpx/pr79631.c: New test.

From-SVN: r245998
This commit is contained in:
Martin Liska 2017-03-09 11:10:02 +01:00 committed by Martin Liska
parent 3828bb0d7e
commit 8a7df0316d
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* tree-chkp-opt.c (chkp_is_constant_addr): Call
tree_int_cst_sign_bit just for INTEGER constants.
2017-03-09 Martin Liska <mliska@suse.cz>
PR target/65705

View File

@ -1,3 +1,8 @@
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* gcc.target/i386/mpx/pr79631.c: New test.
2017-03-09 Martin Liska <mliska@suse.cz>
PR target/65705

View File

@ -0,0 +1,15 @@
/* { dg-do compile { target { ! x32 } } } */
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
typedef struct { int _mp_size; } mpz_t[1];
int a, b;
void fn1()
{
mpz_t c[1][b];
for (;;) {
int d = 0 >= 0 ? 0 == 0 ? c[0][0]->_mp_size ? -1 : 0 : 0 : 0,
e = 0 >= 0 ? 0 == 0 ? c[1][1]->_mp_size ? -1 : 0 : 0 : 0;
if (d != e)
a++;
}
}

View File

@ -239,9 +239,11 @@ chkp_is_constant_addr (const address_t &addr, int *sign)
return false;
else if (addr.pol[0].var)
return false;
else if (TREE_CODE (addr.pol[0].cst) != INTEGER_CST)
return false;
else if (integer_zerop (addr.pol[0].cst))
*sign = 0;
else if (tree_int_cst_sign_bit (addr.pol[0].cst))
else if (tree_int_cst_sign_bit (addr.pol[0].cst))
*sign = -1;
else
*sign = 1;