diff mbox

Do not generate debug info for compiler generated VLAs

Message ID 201010161629.01449.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou Oct. 16, 2010, 2:29 p.m. UTC
> We want no debug info at all for the type though; I think that dwarf2out.c
> already ensures that.

Here's what I ended up installing on mainline and 4.5 branch, thanks.


        * gimplify.c (gimplify_type_sizes) <ARRAY_TYPE>: If the type is to be
        ignored for debug info purposes, do not clear the DECL_IGNORED_P flag
        on the bounds of its domain.
	* tree.h (DECL_IGNORED_P): Document effect on TYPE_DECL specifically.
diff mbox

Patch

Index: gimplify.c
===================================================================
--- gimplify.c	(revision 165468)
+++ gimplify.c	(working copy)
@@ -7535,7 +7535,10 @@  gimplify_type_sizes (tree type, gimple_s
       /* Ensure VLA bounds aren't removed, for -O0 they should be variables
 	 with assigned stack slots, for -O1+ -g they should be tracked
 	 by VTA.  */
-      if (TYPE_DOMAIN (type)
+      if (!(TYPE_NAME (type)
+	    && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+	    && DECL_IGNORED_P (TYPE_NAME (type)))
+	  && TYPE_DOMAIN (type)
 	  && INTEGRAL_TYPE_P (TYPE_DOMAIN (type)))
 	{
 	  t = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
Index: tree.h
===================================================================
--- tree.h	(revision 165468)
+++ tree.h	(working copy)
@@ -2624,8 +2624,9 @@  struct GTY(()) tree_decl_minimal {
   (FUNCTION_DECL_CHECK (NODE)->function_decl.personality)
 
 /* Nonzero for a given ..._DECL node means that the name of this node should
-   be ignored for symbolic debug purposes.  Moreover, for a FUNCTION_DECL,
-   the body of the function should also be ignored.  */
+   be ignored for symbolic debug purposes.  For a TYPE_DECL, this means that
+   the associated type should be ignored.  For a FUNCTION_DECL, the body of
+   the function should also be ignored.  */
 #define DECL_IGNORED_P(NODE) \
   (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)