From patchwork Sat Oct 16 14:29:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 68033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id ED710B70EA for ; Sun, 17 Oct 2010 01:37:02 +1100 (EST) Received: (qmail 24321 invoked by alias); 16 Oct 2010 14:36:59 -0000 Received: (qmail 24087 invoked by uid 22791); 16 Oct 2010 14:36:58 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Oct 2010 14:36:53 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2EE84CB0342; Sat, 16 Oct 2010 16:36:51 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v9A77Ex+lnwQ; Sat, 16 Oct 2010 16:36:51 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 0BF47CB033E; Sat, 16 Oct 2010 16:36:51 +0200 (CEST) From: Eric Botcazou To: Richard Guenther Subject: Re: [patch] Do not generate debug info for compiler generated VLAs Date: Sat, 16 Oct 2010 16:29:01 +0200 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: <201010140116.06349.ebotcazou@adacore.com> <201010151100.08859.ebotcazou@adacore.com> In-Reply-To: <201010151100.08859.ebotcazou@adacore.com> MIME-Version: 1.0 Message-Id: <201010161629.01449.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org > 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) : 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. 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)