On 01/25/2013 11:21 AM, Jakub Jelinek wrote:
Hi!

As shown by the testcases, we shouldn't try to optimize volatile
stores resp. loads in tree-ssa-phiopt.c.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2013-01-25  Jakub Jelinek  <ja...@redhat.com>

        PR tree-optimization/56098
        * tree-ssa-phiopt.c (nt_init_block): Don't call add_or_mark_expr
        for stmts with volatile ops.
        (cond_store_replacement): Don't optimize if assign has volatile ops.
        (cond_if_else_store_replacement_1): Don't optimize if either
        then_assign or else_assign have volatile ops.
        (hoist_adjacent_loads): Don't optimize if either def1 or def2 have
        volatile ops.

        * gcc.dg/pr56098-1.c: New test.
        * gcc.dg/pr56098-2.c: New test.
OK for trunk.

Thanks,
Jeff

Reply via email to