This fixes a latent issue in predictive commoning - we shouldn't try
to optimize invariant volatile references.  The following patch simply
disables handling of all volatile references similar to possibly
throwing ones.

Bootstrap and regtest in progress on x86_64-unknown-linux-gnu.

Richard.

2011-07-29  Richard Guenther  <rguent...@suse.de>

        PR tree-optimization/49893
        * tree-predcom.c (suitable_reference_p): Volatile references
        are not suitable.

Index: gcc/tree-predcom.c
===================================================================
*** gcc/tree-predcom.c  (revision 176869)
--- gcc/tree-predcom.c  (working copy)
*************** suitable_reference_p (struct data_refere
*** 598,603 ****
--- 598,604 ----
    tree ref = DR_REF (a), step = DR_STEP (a);
  
    if (!step
+       || TREE_THIS_VOLATILE (ref)
        || !is_gimple_reg_type (TREE_TYPE (ref))
        || tree_could_throw_p (ref))
      return false;

Reply via email to