* tree-ssa-live.c (remove_unused_scope_block_p): Don't remove
DECL_IGNORED_P non-reg vars if they are used.
+ PR tree-optimization/47391
+ * varpool.c (const_value_known_p): Return false if
+ decl is volatile.
+
2011-01-21 Kai Tietz <kai.tietz@onevision.com>
PR bootstrap/47215
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47391
+ * gcc.dg/pr47391.c: New test.
+
2011-01-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++.dg/template/char1.C: Use signed char.
--- /dev/null
+/* PR tree-optimization/47391 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+const volatile int v = 1;
+int i = 0;
+
+void
+foo (void)
+{
+ i = v;
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "i = 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
/* Callgraph handling code.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jan Hubicka
gcc_assert (TREE_CODE (decl) == VAR_DECL);
- if (!TREE_READONLY (decl))
+ if (!TREE_READONLY (decl) || TREE_THIS_VOLATILE (decl))
return false;
/* Gimplifier takes away constructors of local vars */