re PR tree-optimization/54767 (Incorrect code generated with "-O2 -fcheck=bounds")
2013-02-05 Richard Biener <rguenther@suse.de> PR tree-optimization/54767 * tree-vrp.c (vrp_visit_phi_node): For PHI arguments coming via backedges drop all symbolical range information. (execute_vrp): Compute backedges. * gfortran.fortran-torture/execute/pr54767.f90: New testcase. From-SVN: r195754
This commit is contained in:
parent
aad8e2e600
commit
f8d7d4b7ff
|
@ -1,3 +1,10 @@
|
|||
2013-02-05 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/54767
|
||||
* tree-vrp.c (vrp_visit_phi_node): For PHI arguments coming via
|
||||
backedges drop all symbolical range information.
|
||||
(execute_vrp): Compute backedges.
|
||||
|
||||
2013-02-04 Richard Biener <rguenther@suse.de>
|
||||
|
||||
Backport from mainline
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-02-15 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/54767
|
||||
* gfortran.fortran-torture/execute/pr54767.f90: New testcase.
|
||||
|
||||
2013-02-04 Janis Johnson <janisjo@codesourcery.com>
|
||||
|
||||
PR testsuite/56206
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
SUBROUTINE XXX (IL, IU)
|
||||
implicit none
|
||||
integer, INTENT(IN) :: IL, IU
|
||||
|
||||
integer :: NXX (14) = (/ 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14 /)
|
||||
integer :: ivvv, ia, ja, iaii
|
||||
logical :: qop
|
||||
|
||||
QOP=.FALSE.
|
||||
|
||||
DO IA=IL,IU
|
||||
JA=NXX(IA)
|
||||
IF (.NOT. QOP .and. JA.GT.0) THEN
|
||||
IAII=IA
|
||||
QOP=.TRUE.
|
||||
ENDIF
|
||||
|
||||
IF (QOP) THEN
|
||||
ivvv=IA-IAII+1 ! mis-compiled
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
IF (ivvv.NE.2) THEN
|
||||
call abort
|
||||
ENDIF
|
||||
END subroutine
|
||||
|
||||
program p
|
||||
implicit none
|
||||
CALL XXX (1, 3)
|
||||
end
|
|
@ -6620,6 +6620,20 @@ vrp_visit_phi_node (gimple phi)
|
|||
if (TREE_CODE (arg) == SSA_NAME)
|
||||
{
|
||||
vr_arg = *(get_value_range (arg));
|
||||
/* Do not allow equivalences or symbolic ranges to leak in from
|
||||
backedges. That creates invalid equivalencies. */
|
||||
if (e->flags & EDGE_DFS_BACK
|
||||
&& (vr_arg.type == VR_RANGE
|
||||
|| vr_arg.type == VR_ANTI_RANGE))
|
||||
{
|
||||
vr_arg.equiv = NULL;
|
||||
if (symbolic_range_p (&vr_arg))
|
||||
{
|
||||
vr_arg.type = VR_VARYING;
|
||||
vr_arg.min = NULL_TREE;
|
||||
vr_arg.max = NULL_TREE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7871,6 +7885,9 @@ execute_vrp (void)
|
|||
rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
|
||||
scev_initialize ();
|
||||
|
||||
/* ??? This ends up using stale EDGE_DFS_BACK for liveness computation.
|
||||
Inserting assertions may split edges which will invalidate
|
||||
EDGE_DFS_BACK. */
|
||||
insert_range_assertions ();
|
||||
|
||||
/* Estimate number of iterations - but do not use undefined behavior
|
||||
|
@ -7883,6 +7900,9 @@ execute_vrp (void)
|
|||
to_update_switch_stmts = VEC_alloc (switch_update, heap, 5);
|
||||
threadedge_initialize_values ();
|
||||
|
||||
/* For visiting PHI nodes we need EDGE_DFS_BACK computed. */
|
||||
mark_dfs_back_edges ();
|
||||
|
||||
vrp_initialize ();
|
||||
ssa_propagate (vrp_visit_stmt, vrp_visit_phi_node);
|
||||
vrp_finalize ();
|
||||
|
|
Loading…
Reference in New Issue