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: [PATCH] Small fix for make_decl_rtl_for_debug


On Mon, 22 Mar 2010, Jakub Jelinek wrote:

> Hi!
> 
> As already mentioned by me in the VTA alias set discrepancy
> thread, flag_mudflap is another thing that is IMHO undesirable
> to have set during make_decl_rtl make_decl_rtl_for_debug calls,
> as that means we register the decl in different places with -g0
> vs. -g.  make_decl_rtl ends with:
>   /* Make this function static known to the mudflap runtime.  */
>   if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
>     mudflap_enqueue_decl (decl);
> and that code pushes the decl into a vector which is later on used for code
> generation.  Fixed thusly, ok for trunk?

Ok.

Thanks,
Richard.

> 2010-03-22  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* varasm.c (make_decl_rtl_for_debug): Also clear
> 	flag_mudflap for the duration of make_decl_rtl call.
> 
> --- gcc/varasm.c.jj	2010-03-19 17:52:59.000000000 +0100
> +++ gcc/varasm.c	2010-03-21 21:42:22.000000000 +0100
> @@ -1484,7 +1484,7 @@ make_decl_rtl (tree decl)
>  rtx
>  make_decl_rtl_for_debug (tree decl)
>  {
> -  unsigned int save_aliasing_flag;
> +  unsigned int save_aliasing_flag, save_mudflap_flag;
>    rtx rtl;
>  
>    if (DECL_RTL_SET_P (decl))
> @@ -1495,9 +1495,12 @@ make_decl_rtl_for_debug (tree decl)
>       we do not want to create alias sets that will throw the alias
>       numbers off in the comparison dumps.  So... clearing
>       flag_strict_aliasing will keep new_alias_set() from creating a
> -     new set.  */
> +     new set.  It is undesirable to register decl with mudflap
> +     in this case as well.  */
>    save_aliasing_flag = flag_strict_aliasing;
>    flag_strict_aliasing = 0;
> +  save_mudflap_flag = flag_mudflap;
> +  flag_mudflap = 0;
>  
>    rtl = DECL_RTL (decl);
>    /* Reset DECL_RTL back, as various parts of the compiler expects
> @@ -1505,6 +1508,7 @@ make_decl_rtl_for_debug (tree decl)
>    SET_DECL_RTL (decl, NULL);
>  
>    flag_strict_aliasing = save_aliasing_flag;
> +  flag_mudflap = save_mudflap_flag;
>  
>    return rtl;
>  }
> 
> 	Jakub
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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