+2004-09-22 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/16721
+ * tree-dfa.c (dump_variable): Show TREE_THIS_VOLATILE.
+ * tree-ssa-alias.c (create_memory_tag): Move setting of
+ TREE_THIS_VOLATILE ...
+ (get_tmt_for): ... here.
+
2004-09-22 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.md (cmove splitter): Fix formatting.
+2004-09-22 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/16721
+ * testsuite/gcc.dg/tree-ssa/pr16721.c: New test.
+
2004-09-23 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.dg/20030123-1.c: Add prototypes for builtin functions.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */
+
+struct data {
+ volatile unsigned long *addr;
+} *p;
+
+int test()
+{
+ *p->addr;
+ return 0;
+}
+
+/* The load from p->addr should not disappear. */
+/* { dg-final { scan-tree-dump-times "\->addr" 1 "optimized"} } */
if (is_global_var (var))
fprintf (file, ", is global");
+ if (TREE_THIS_VOLATILE (var))
+ fprintf (file, ", is volatile");
+
if (is_call_clobbered (var))
fprintf (file, ", call clobbered");
determine whether they should be considered globals. */
DECL_CONTEXT (tag) = current_function_decl;
- /* If the pointed-to type is volatile, so is the tag. */
- TREE_THIS_VOLATILE (tag) = TREE_THIS_VOLATILE (type);
-
/* Memory tags are by definition addressable. This also prevents
is_gimple_ref frome confusing memory tags with optimizable
variables. */
ai->pointers[ai->num_pointers++] = alias_map;
}
+ /* If the pointed-to type is volatile, so is the tag. */
+ TREE_THIS_VOLATILE (tag) = TREE_THIS_VOLATILE (tag_type);
+
/* Make sure that the type tag has the same alias set as the
pointed-to type. */
gcc_assert (tag_set == get_alias_set (tag));