[Bug middle-end/85989] [6/7 Regression] Incorrect result for example involving unary minus in a loop

rsandifo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jun 23 12:21:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85989

--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Sat Jun 23 12:21:18 2018
New Revision: 261984

URL: https://gcc.gnu.org/viewcvs?rev=261984&root=gcc&view=rev
Log:
Fix phi backedge detection in backprop (PR85989)

Backport trunk r261064.

2018-06-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
        PR tree-optimization/85989
        * gimple-ssa-backprop.c (backprop::m_visited_phis): New member
        variable.
        (backprop::intersect_uses): Check it when deciding whether this
        is a backedge reference.
        (backprop::process_block): Add each phi to m_visited_phis
        after visiting it, then clear it at the end.

gcc/testsuite/
        PR tree-optimization/85989
        * gcc.dg/torture/pr85989.c: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr85989.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/gimple-ssa-backprop.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list