------- Comment #5 from jamborm at gcc dot gnu dot org 2010-06-15 15:08 ------- Unfortunately I don't see this happening on the x86_64-linux -> arm-linux-gnueabi cross compiler I built for myself. The generated assembly has all four elements in the initialization of CSWTCH.2 and the intermediate tree dumps from the cross compiler are not really different from the ones from a native x86_64 compiler.
Could you please first try to reproduce the bug with the -fno-tree-switch-conversion swithch? If that helps, the bug is indeed in the lookup table generation and then I would like you to provide the dump files generated by switches -fdump-tree-tailr1-slim -fdump-tree-switchconv It would be great if you could do that with a gcc (4.5 or trunk) patched with the following hunk but maybe we will be able to see something interesting even without it. Thanks. Index: gcc/tree-switch-conversion.c =================================================================== --- gcc/tree-switch-conversion.c (revision 160709) +++ gcc/tree-switch-conversion.c (working copy) @@ -517,6 +517,13 @@ array_type = build_array_type (value_type, arr_index_type); ctor = build_constructor (array_type, info.constructors[num]); TREE_CONSTANT (ctor) = true; + if (dump_file) + { + fprintf (dump_file, "\n\nCONSTRUCTOR %i:\n", num); + + print_node (dump_file, "", ctor, 0); + fprintf (dump_file, "\n"); + } decl = build_decl (loc, VAR_DECL, NULL_TREE, array_type); TREE_STATIC (decl) = 1; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328