re PR middle-end/70747 (ICE on valid code on x86_64-linux-gnu: verify_gimple failed)

2016-04-21  Richard Biener  <rguenther@suse.de>

	PR middle-end/70747
	* fold-const.c (fold_comparison): Return properly typed
	constant boolean.

	* gcc.dg/pr70747.c: New testcase.

From-SVN: r235335
This commit is contained in:
Richard Biener 2016-04-21 11:52:50 +00:00 committed by Richard Biener
parent 2359e571cd
commit aef4aab0cc
4 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-04-21 Richard Biener <rguenther@suse.de>
PR middle-end/70747
* fold-const.c (fold_comparison): Return properly typed
constant boolean.
2016-04-21 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/70715

View File

@ -8676,11 +8676,11 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
case EQ_EXPR:
case LE_EXPR:
case LT_EXPR:
return boolean_false_node;
return constant_boolean_node (false, type);
case GE_EXPR:
case GT_EXPR:
case NE_EXPR:
return boolean_true_node;
return constant_boolean_node (true, type);
default:
gcc_unreachable ();
}

View File

@ -1,3 +1,8 @@
2016-04-21 Richard Biener <rguenther@suse.de>
PR middle-end/70747
* gcc.dg/pr70747.c: New testcase.
2016-04-21 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/70715

View File

@ -0,0 +1,10 @@
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
int *a, b;
void fn1 ()
{
a = __builtin_malloc (sizeof(int)*2);
b = &a[1] == (0, 0); /* { dg-warning "comparison between pointer and integer" } */
}