From b65e51a81fd877211cacb75bc07b56dcb45444b4 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sat, 1 Sep 2007 09:07:17 +0000 Subject: [PATCH] tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE instead of TREE_THIS_VOLATILE. 2007-09-01 Richard Guenther * tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE instead of TREE_THIS_VOLATILE. * tree-ssa-operands.c (add_virtual_operand): Do not set has_volatile_ops. Do not check s_ann for NULL. (get_indirect_ref_operands): Likewise. (get_expr_operands): Likewise. For all reference trees set has_volatile_ops based on TREE_THIS_VOLATILE. Also check base of reference for TREE_THIS_VOLATILE. From-SVN: r128012 --- gcc/ChangeLog | 11 +++++++++++ gcc/tree-ssa-alias.c | 2 +- gcc/tree-ssa-operands.c | 26 ++++++++++++-------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a90d832..9a267bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 2007-09-01 Richard Guenther + * tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE + instead of TREE_THIS_VOLATILE. + * tree-ssa-operands.c (add_virtual_operand): Do not set + has_volatile_ops. Do not check s_ann for NULL. + (get_indirect_ref_operands): Likewise. + (get_expr_operands): Likewise. For all reference trees + set has_volatile_ops based on TREE_THIS_VOLATILE. Also + check base of reference for TREE_THIS_VOLATILE. + +2007-09-01 Richard Guenther + * tree-cfg.c (verify_gimple_expr): Fix check for conversions between integral types. Also allow conversions between pointer types. diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 2dc2351..52ca86b 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2216,7 +2216,7 @@ create_name_tags (void) /* Inherit volatility from the pointed-to type. */ TREE_THIS_VOLATILE (pi->name_mem_tag) - |= TREE_THIS_VOLATILE (TREE_TYPE (TREE_TYPE (ptr))); + |= TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (ptr))); /* Mark the new name tag for renaming. */ mark_sym_for_renaming (pi->name_mem_tag); diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 7217b55..4996e09 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1466,11 +1466,6 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, /* Mark the statement as having memory operands. */ s_ann->references_memory = true; - /* Mark statements with volatile operands. Optimizers should back - off from statements having volatile operands. */ - if (TREE_THIS_VOLATILE (sym) && s_ann) - s_ann->has_volatile_ops = true; - /* If the variable cannot be modified and this is a VDEF change it into a VUSE. This happens when read-only variables are marked call-clobbered and/or aliased to writable variables. So we only @@ -1499,7 +1494,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, if (aliases == NULL) { - if (s_ann && !gimple_aliases_computed_p (cfun)) + if (!gimple_aliases_computed_p (cfun)) s_ann->has_volatile_ops = true; /* The variable is not aliased or it is an alias tag. */ @@ -1630,7 +1625,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, stmt_ann_t s_ann = stmt_ann (stmt); s_ann->references_memory = true; - if (s_ann && TREE_THIS_VOLATILE (expr)) + if (TREE_THIS_VOLATILE (expr)) s_ann->has_volatile_ops = true; if (SSA_VAR_P (ptr)) @@ -1677,8 +1672,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, /* Aliasing information is missing; mark statement as volatile so we won't optimize it out too actively. */ - else if (s_ann - && !gimple_aliases_computed_p (cfun) + else if (!gimple_aliases_computed_p (cfun) && (flags & opf_def)) s_ann->has_volatile_ops = true; } @@ -1688,8 +1682,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, /* If a constant is used as a pointer, we can't generate a real operand for it but we mark the statement volatile to prevent optimizations from messing things up. */ - if (s_ann) - s_ann->has_volatile_ops = true; + s_ann->has_volatile_ops = true; return; } else @@ -2121,6 +2114,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) HOST_WIDE_INT offset, size, maxsize; bool none = true; + if (TREE_THIS_VOLATILE (expr)) + s_ann->has_volatile_ops = true; + /* This component reference becomes an access to all of the subvariables it can touch, if we can determine that, but *NOT* the real one. If we can't determine which fields we @@ -2148,8 +2144,10 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) if (!none) flags |= opf_no_vops; - if (TREE_THIS_VOLATILE (expr)) - get_stmt_ann (stmt)->has_volatile_ops = true; + if ((DECL_P (ref) && TREE_THIS_VOLATILE (ref)) + || (TREE_CODE (ref) == SSA_NAME + && TREE_THIS_VOLATILE (SSA_NAME_VAR (ref)))) + s_ann->has_volatile_ops = true; } else if (TREE_CODE (ref) == INDIRECT_REF) { @@ -2165,7 +2163,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) if (code == COMPONENT_REF) { - if (s_ann && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1))) + if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1))) s_ann->has_volatile_ops = true; get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_use); } -- 2.7.4