Evaluate condition arguments with the correct type.
Processing of a cond_expr requires that a range of the correct type for the operands of the cond_expr is passed in. PR tree-optimization/106556 gcc/ * gimple-range-gori.cc (gori_compute::condexpr_adjust): Use the type of the cond_expr operands being evaluted. gcc/testsuite/ * gfortran.dg/pr106556.f90: New.
This commit is contained in:
parent
053876cdbe
commit
ef623bb585
2 changed files with 16 additions and 5 deletions
|
@ -1398,16 +1398,17 @@ gori_compute::condexpr_adjust (vrange &r1, vrange &r2, gimple *, tree cond,
|
|||
}
|
||||
|
||||
// Now solve for SSA1 or SSA2 if they are in the dependency chain.
|
||||
Value_Range tmp (type);
|
||||
if (ssa1 && in_chain_p (ssa1, cond_name))
|
||||
{
|
||||
if (compute_operand_range (tmp, def_stmt, cond_true, ssa1, src))
|
||||
r1.intersect (tmp);
|
||||
Value_Range tmp1 (TREE_TYPE (ssa1));
|
||||
if (compute_operand_range (tmp1, def_stmt, cond_true, ssa1, src))
|
||||
r1.intersect (tmp1);
|
||||
}
|
||||
if (ssa2 && in_chain_p (ssa2, cond_name))
|
||||
{
|
||||
if (compute_operand_range (tmp, def_stmt, cond_false, ssa2, src))
|
||||
r2.intersect (tmp);
|
||||
Value_Range tmp2 (TREE_TYPE (ssa2));
|
||||
if (compute_operand_range (tmp2, def_stmt, cond_false, ssa2, src))
|
||||
r2.intersect (tmp2);
|
||||
}
|
||||
if (idx)
|
||||
{
|
||||
|
|
10
gcc/testsuite/gfortran.dg/pr106556.f90
Normal file
10
gcc/testsuite/gfortran.dg/pr106556.f90
Normal file
|
@ -0,0 +1,10 @@
|
|||
! { dg-do compile }
|
||||
! { dg-options "-O1 -fnon-call-exceptions -ftree-loop-if-convert" }
|
||||
|
||||
|
||||
program p
|
||||
real :: a(2)
|
||||
|
||||
a(:) = 1.0
|
||||
if (minloc (a, dim = 1).ne.1) STOP 1
|
||||
end
|
Loading…
Add table
Reference in a new issue