[PATCH,PR43478] preserve dying REGs in debug temps

Steven Bosscher stevenb.gcc@gmail.com
Mon May 3 08:48:00 GMT 2010


On Mon, May 3, 2010 at 9:55 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>
> The same langhook is used pretty much in many other places deep down in
> language independent parts of the compiler (look at many places in the
> vectorizer, or dojump.c, ...).

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.

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...

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.

Ciao!
Steven



More information about the Gcc-patches mailing list