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

--- Comment #7 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Author: aoliva
Date: Tue Nov  3 00:30:07 2015
New Revision: 229690

URL: https://gcc.gnu.org/viewcvs?rev=229690&root=gcc&view=rev
Log:
[PR68083] don't introduce undefined behavior in ifcombine

The ifcombine pass may move a conditional access to an uninitialized
value before the condition that ensures it is always well-defined,
thus introducing undefined behavior.  Stop it from doing so.

for  gcc/ChangeLog

        PR tree-optimization/68083
        * tree-ssa-ifcombine.c: Include tree-ssa.h.
        (bb_no_side_effects_p): Test for undefined uses too.
        * tree-ssa.c (gimple_uses_undefined_value_p): New.
        * tree-ssa.h (gimple_uses_undefined_value_p): Declare.

for  gcc/testsuite/ChangeLog

        PR tree-optimization/68083
        * gcc.dg/torture/pr68083.c: New.  From Zhendong Su.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr68083.c
Modified:
    trunk/ChangeLog
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-ifcombine.c
    trunk/gcc/tree-ssa.c
    trunk/gcc/tree-ssa.h

Reply via email to