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]

Re: Make switch convert arrays readonly


On Tue, Jun 1, 2010 at 11:40 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>
> 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?

Ok.

Thanks,
Richard.

> ? ? ? ?* 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]