* tree-switch-conversion.c (build_one_array): Set constructor to be
static.
* varpool.c (varpool_finalize_decl): Compute const_value_known.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163860
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-09-04 Jan Hubicka <jh@suse.cz>
+
+ * tree-switch-conversion.c (build_one_array): Set constructor to be
+ static.
+ * varpool.c (varpool_finalize_decl): Compute const_value_known.
+
2010-09-04 Richard Guenther <rguenther@suse.de>
PR bootstrap/45519
+2010-09-04 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/foldconst-1.c: New testcase.
+
2010-09-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/45507
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+void bar (unsigned int);
+
+void
+foo (void)
+{
+ char buf[1] = { 3 };
+ const char *p = buf;
+ const char **q = &p;
+ unsigned int ch;
+ switch (**q)
+ {
+ case 1: ch = 5; break;
+ case 2: ch = 4; break;
+ case 3: ch = 3; break;
+ case 4: ch = 2; break;
+ case 5: ch = 1; break;
+ default: ch = 0; break;
+ }
+ bar (ch);
+}
+/* The switch should be switch converted and later constant propagated. */
+/* { dg-final { scan-tree-dump-not "CSWTCH" "optimized"} } */
+/* { dg-final { scan-tree-dump-not "switch" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
array_type = build_array_type (value_type, arr_index_type);
ctor = build_constructor (array_type, info.constructors[num]);
TREE_CONSTANT (ctor) = true;
+ TREE_STATIC (ctor) = true;
decl = build_decl (loc, VAR_DECL, NULL_TREE, array_type);
TREE_STATIC (decl) = 1;
there. */
else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
varpool_mark_needed_node (node);
+ node->const_value_known |= varpool_decide_const_value_known (node);
if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
}