re PR tree-optimization/79276 (ICE: Segmentation fault in VRP pass)

2017-01-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79276
	* tree-vrp.c (process_assert_insertions): Properly adjust common
	when removing a duplicate.

	* gcc.dg/torture/pr79276.c: New testcase.

From-SVN: r245026
This commit is contained in:
Richard Biener 2017-01-30 14:24:37 +00:00 committed by Richard Biener
parent fcc216ec44
commit 0c7247cc1e
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79276
* tree-vrp.c (process_assert_insertions): Properly adjust common
when removing a duplicate.
* gcc.dg/torture/pr79276.c: New testcase.
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79256

View File

@ -1,3 +1,8 @@
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79276
* gcc.dg/torture/pr79276.c: New testcase.
2017-01-30 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79240

View File

@ -0,0 +1,8 @@
/* { dg-do compile } */
short int
ix (int *ld, short int oi)
{
*ld = ((unsigned short int)oi | oi) && !!(*ld);
return (oi != 0) ? oi : 1;
}

View File

@ -6544,6 +6544,11 @@ process_assert_insertions (void)
else if (loc->e == asserts[j-1]->e)
{
/* Remove duplicate asserts. */
if (commonj == j - 1)
{
commonj = j;
common = loc;
}
free (asserts[j-1]);
asserts[j-1] = NULL;
}