This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Make switch convert arrays readonly


Hi,
the most common variables we promote readonly are ones produced by switch conversion.
This patch adds the missing TREE_READONLY set there.
It should avoid the work later and let early passes to propagate further.

Bootstrapped/regtested x86_64-linux, OK?
	* tree-switch-conversion.c (build_one_array): Make it readonly.
Index: tree-switch-conversion.c
===================================================================
--- tree-switch-conversion.c	(revision 160079)
+++ tree-switch-conversion.c	(working copy)
@@ -526,6 +526,7 @@
       DECL_NAME (decl) = create_tmp_var_name ("CSWTCH");
       DECL_ARTIFICIAL (decl) = 1;
       TREE_CONSTANT (decl) = 1;
+      TREE_READONLY (decl) = 1;
       add_referenced_var (decl);
       varpool_mark_needed_node (varpool_node (decl));
       varpool_finalize_decl (decl);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]