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]

[patch] Do not generate debug info for compiler generated VLAs


Hi,

in February Jakub made a change to the gimplifier in order to generate debug 
info for bounds of VLAs.  This has a significant impact on the code itself in 
Ada (typically +2% code size and +1% compilation time at -O0) because the Ada 
compiler itself generates a lot of VLAs for various constructs; now gigi puts 
DECL_IGNORED_P on these VLAs so the gimplifier shouldn't overrule it.

Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?  What about the 
4.5 branch?


2010-10-13  Eric Botcazou  <ebotcazou@adacore.com>

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

-- 
Eric Botcazou
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 165411)
+++ 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]