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,PR43478] preserve dying REGs in debug temps


On Mon, May 03, 2010 at 10:47:59AM +0200, Steven Bosscher wrote:
> While this is true, this *does* add probably the deepest use of
> make_node. I think it is wrong to create trees at this stage.

It is certainly needed to create a tree at that point, a DEBUG_EXPR
must refer to a DEBUG_EXPR_DECL that holds the info.
DEBUG_EXPR_DECLs are created in tree-ssa.c, then during expand (cfgexpand.c)
and now this patch wants them to introduce even later.

> And note, df-problems.c doesn't include tree.h, so this is one of thos
> examples where a change slips in a hard-to-detect dependency on a
> header that's included by another header. We should try to clean up
> GCC such that no header file includes other header files...

So it could include tree.h explicitly.

> Anyway, the point of my objection should be clear: Iff GCC wants to be
> more modularized, then this is a step in the wrong direction.
> 
> Perhaps this whole tree block,
> 
> +  /* Set up debug DEBUG_EXPR_DECL / DEBUG_EXPR pair.  */
> +  ddecl = make_node (DEBUG_EXPR_DECL);
> +  DECL_ARTIFICIAL (ddecl) = 1;
> +  /* ??? Take mode from REG note?  */
> +  TREE_TYPE (ddecl) = lang_hooks.types.type_for_mode (GET_MODE (reg), 1);
> +  DECL_MODE (ddecl) = GET_MODE (reg);
> +  dval = gen_rtx_DEBUG_EXPR (GET_MODE (reg));
> +  DEBUG_EXPR_TREE_DECL (dval) = ddecl;
> +  SET_DECL_RTL (ddecl, dval);
> 
> can be stuffed away in a debug hook (debug_hooks.get_dummy_decl, say)
> so that df-* remains tree-free.

Why a debug_hook?  There is nothing hookish on it, we don't hookize any
of the VTA stuff based on debug info format.
Yes, this hunk could be moved into a new function, have something like
if (REG_EXPR (reg) && TYPE_MODE (TREE_TYPE (REG_EXPR (reg))) == GET_MODE (reg))
  TREE_TYPE (ddecl) = TREE_TYPE (REG_EXPR (reg));
else
  TREE_TYPE (ddecl) = lang_hooks.types.type_for_mode (GET_MODE (reg), 1);
but it is primarily a RTL operation, so needs to live in some RTL source
file, rather than tree-ish one.  And, df-problems.c would be the only caller
of it anyway.

	Jakub


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