re PR tree-optimization/60849 (bogus comparison result type)
2014-04-17 Richard Biener <rguenther@suse.de> PR middle-end/60849 * tree-ssa-propagate.c (valid_gimple_rhs_p): Only allow effective boolean results for comparisons. * g++.dg/opt/pr60849.C: New testcase. From-SVN: r209469
This commit is contained in:
parent
730e78b045
commit
83ad208e2c
@ -1,3 +1,9 @@
|
||||
2014-04-17 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60849
|
||||
* tree-ssa-propagate.c (valid_gimple_rhs_p): Only allow effective
|
||||
boolean results for comparisons.
|
||||
|
||||
2014-04-17 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/60836
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-04-17 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60849
|
||||
* g++.dg/opt/pr60849.C: New testcase.
|
||||
|
||||
2014-04-17 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/60836
|
||||
|
13
gcc/testsuite/g++.dg/opt/pr60849.C
Normal file
13
gcc/testsuite/g++.dg/opt/pr60849.C
Normal file
@ -0,0 +1,13 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-O2" }
|
||||
|
||||
int g;
|
||||
|
||||
extern "C" int isnan ();
|
||||
|
||||
void foo(float a) {
|
||||
int (*xx)(...);
|
||||
xx = isnan;
|
||||
if (xx(a))
|
||||
g++;
|
||||
}
|
@ -571,8 +571,14 @@ valid_gimple_rhs_p (tree expr)
|
||||
/* All constants are ok. */
|
||||
break;
|
||||
|
||||
case tcc_binary:
|
||||
case tcc_comparison:
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (expr))
|
||||
|| (TREE_CODE (TREE_TYPE (expr)) != BOOLEAN_TYPE
|
||||
&& TYPE_PRECISION (TREE_TYPE (expr)) != 1))
|
||||
return false;
|
||||
|
||||
/* Fallthru. */
|
||||
case tcc_binary:
|
||||
if (!is_gimple_val (TREE_OPERAND (expr, 0))
|
||||
|| !is_gimple_val (TREE_OPERAND (expr, 1)))
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user