- fetch = build4 (ARRAY_REF, value_type, decl, tidx, NULL_TREE,
- NULL_TREE);
- load = gimple_build_assign (name, fetch);
- SSA_NAME_DEF_STMT (name) = load;
+ cst = constructor_contains_same_values_p (info.constructors[num]);
+ if (cst)
+ load = gimple_build_assign (name, cst);
+ else
+ {
+ tree array_type, ctor, decl, value_type, fetch;
+
+ value_type = TREE_TYPE (info.default_values[num]);
+ array_type = build_array_type (value_type, arr_index_type);
+ ctor = build_constructor (array_type, info.constructors[num]);
+ TREE_CONSTANT (ctor) = true;
+
+ decl = build_decl (loc, VAR_DECL, NULL_TREE, array_type);
+ TREE_STATIC (decl) = 1;
+ DECL_INITIAL (decl) = ctor;
+
+ DECL_NAME (decl) = create_tmp_var_name ("CSWTCH");
+ DECL_ARTIFICIAL (decl) = 1;
+ TREE_CONSTANT (decl) = 1;
+ add_referenced_var (decl);
+ varpool_mark_needed_node (varpool_node (decl));
+ varpool_finalize_decl (decl);
+
+ fetch = build4 (ARRAY_REF, value_type, decl, tidx, NULL_TREE,
+ NULL_TREE);
+ load = gimple_build_assign (name, fetch);
+ }