re PR tree-optimization/22000 (Read from volatile member of struct is optimized away)
authorMark Mitchell <mark@codesourcery.com>
Fri, 24 Jun 2005 03:38:05 +0000 (03:38 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 24 Jun 2005 03:38:05 +0000 (03:38 +0000)
PR 22000
* tree-ssa-operands.c (get_expr_operands): Check the volatility of
the FIELD_DECL and set s_ann->has_volatile_ops accordingly.

From-SVN: r101289

gcc/ChangeLog
gcc/tree-ssa-operands.c

index f178518aa81596fa13989a9d63d3517d2d59f9ae..a8a5231d0a8c766649d3d528942a87ebabfab233 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR 22000
+       * tree-ssa-operands.c (get_expr_operands): Check the volatility of
+       the FIELD_DECL and set s_ann->has_volatile_ops accordingly.
+
 2005-06-24  Jan Hubicka  <jh@suse.cz>
 
        * opts.c (decode_options): Enable unit-at-a-time by default at -O1.
index 12bfc780bd32bd17db84c33447ce1319aabd980f..2e263cfa1b30c1c38f56226c7aa0063a3929381e 100644 (file)
@@ -1346,7 +1346,11 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
                             flags & ~opf_kill_def);
        
        if (code == COMPONENT_REF)
-         get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
+         {
+           if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+             s_ann->has_volatile_ops = true; 
+           get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
+         }
        return;
       }
     case WITH_SIZE_EXPR: